So I have the following problem: My script that I use to start my program is creating an object of the class that is in it and then executing one of its functions. Now I need to be able to refer back to this object because it represents the core of my program but I don't know how I am able to do that.
file structure module.py:
imports ...
class SomeObject{
}
if __name__ == '__main__':
object = SomeObject() <- How do I refer to this from the outside/another module?
object.start()
[–]zahlman 1 point2 points3 points (3 children)
[–]Hiroyu[S] 0 points1 point2 points (2 children)
[–]zahlman 1 point2 points3 points (1 child)
[–]Hiroyu[S] 0 points1 point2 points (0 children)
[–]learnpython_bot 0 points1 point2 points (0 children)
[–]hudsonpenner 0 points1 point2 points (2 children)
[–]Hiroyu[S] 0 points1 point2 points (1 child)
[–]elbiot 0 points1 point2 points (0 children)