I created the following example to understand the instances in python
import time;
class test:
mytime = time.time();
def __init__(self):
#self
the mytime = time.time()
is executed when the class is defined(when the interpreter runs the class-definition-code, and this will be run only once, so all instances will get the same mytime
.
if you want different mytime
in different instances, you have to use the self
's one, and access it with instance name rather than class name.