Search code examples
python-2.7tkinterpy2app

quit() using Tkinter not working while executing as an app using py2app. However it works when I run it a python script


  1. I have imported sys
  2. I have tried using sys.quit, again works when I run it as a python script but not as an app.
  3. I have also tried calling root.destroy() inside the app_exit function

context: I have a button called exit which calls an app_exit function which just calls the quit function.


Solution

  • The python quit() and exit() functions are meant to be used in the REPL only. You need to use sys.exit() or raise SystemExit.