Search code examples
pythonpython-3.xtkintercx-freeze

exit() doesn't work with cx_freeze


I have a program in which I use a tkinter button to exit the program with the exit() command. However, when I compile the program through cx_freeze, it doesn't work anymore. I also tried with sys.exit() but then the button doesn't work at all (with or without cx_freeze). Any hint would be appreciated, thanks!


Solution

  • For tkinter applications, the preferred way to exit is name_of_application.destroy(). Using exit() can give unpredictable results.