Dec-11-2016, 03:34 PM
I'm struggling with the overall structure of a python program. The following code works (as-is), but I'm not sure this is the way to let a main program function access class elements. If I move the class Test to a test.py file and then import that file it doesn't work so there must be a better way.
The import being used is: import test
What am I doing wrong?
The import being used is: import test
What am I doing wrong?
class Test(object):
def __init__ (self):
pass
class a(object):
def __init__ (self):
print("a")
class b(object):
def __init__ (self):
print("b")
def main():
t = Test()
t.a()
t.b()
print("Done")
if __name__=="__main__":
main()
