Search code examples
pythonwindowspython-3.xcx-freeze

Python 3.6 quit() not working after porting to exe


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?


Solution

  • As per the comments the quit function doesn't work outside of the interpreter

    def quits():
        sys.exit()
    

    That does the trick