I don't quite understand the usage of classes and import. I have two files as follows:
file test1.py contains the following:
class myClass:
def __init__(self):
pass # do nothing
def update(self):
print("test1")
return
# test this module
m = myClass()
m.update()
file test2.py contains the following:
from test1 import myClass
m = myClass()
m.update()
when I run the module test2.py, it prints the following two lines of text:
test1
test1
Why does it print "test1" two times? I only want to use the class myClass. I don't want test2.py to execute the test program that is in test1.py.