Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how the class works
#4
If there code inside class, that is not method/property, it will be executed at class definition. That is when class attributes are initialized. At the time of class definition methods are not executed, just defined. In this case you probably want to put that code in __init__() method. Look at my example in the thread I linked.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
how the class works - by berckut72 - Mar-16-2020, 06:38 PM
RE: how the class works - by buran - Mar-16-2020, 06:45 PM
RE: how the class works - by berckut72 - Mar-16-2020, 06:48 PM
RE: how the class works - by buran - Mar-16-2020, 06:52 PM
RE: how the class works - by berckut72 - Mar-16-2020, 06:57 PM
RE: how the class works - by buran - Mar-16-2020, 09:43 PM
RE: how the class works - by berckut72 - Mar-17-2020, 05:04 AM
RE: how the class works - by buran - Mar-17-2020, 06:31 AM
RE: how the class works - by berckut72 - Mar-17-2020, 09:54 AM
RE: how the class works - by buran - Mar-17-2020, 09:56 AM
RE: how the class works - by berckut72 - Mar-17-2020, 10:03 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020