I have this program which works fine in the shell [ http://pastebin.com/qsfJt8eE ]
But when I try to generate a .exe using the py2exe I get this error.
Traceback (most recent call last):
File "test1.py", line 470, in <module>
NameError: name 'ACCOUNT' is not defined
Why is this happening?
Relevant block of code (the end of whole file) looks like:
# line 455
if __name__ == "__main__":
app = QtGui.QApplication(sys.argv)
try:
acc = pickle.load(open("personal_account.p", "rb"))
ACCOUNT = Account() # line 460
MAIN = MainFrame()
BALANCE = BalanceFrame(MAIN)
LOANS = LoansFrame(MAIN)
BORROWS = BorrowsFrame(MAIN)
POPUP = PopUp(MAIN, BALANCE, LOANS, BORROWS)
MAIN.show()
sys.exit(app.exec_())
finally:
pickle.dump(ACCOUNT.data, open("personal_account.p", "wb")) # line 470