Code:
def makeApplication():
global app
app = Application.Application()
def getApplication():
global app
return app
if __name__ == "__main__":
global app
makeApplication()
del makeApplication
# Start GUI
app.mainloop()
When I try to use the above code, the program runs just fine, until something outside this module calls getApplication() - then it gives me an error message:
Code:
Exception in Tkinter callback
Traceback (most recent call last):
(lots of stuff removed for brevity)
return app
NameError: global name 'app' is not defined
I cannot, for the life of me, figure out why Python's complaining.