Mar-16-2020, 06:52 PM
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
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs