问题
I have a small tkinter gui that generates some reports. I built a quit button into it. The button works perfectly when I launch the script, but I converted it to an exe with cx_freeze and the entire program is working except the quit button.
def quits():
quit()
I created the quit button to call this quits
function because I read that just calling quit directly could cause problems. Anyone have any idea why this is not working as an exe?
回答1:
As per the comments the quit
function doesn't work outside of the interpreter
def quits():
sys.exit()
That does the trick
来源:https://stackoverflow.com/questions/44787430/python-3-6-quit-not-working-after-porting-to-exe