Is there a problem with using sys.exit() to stop a Tkinter program?
I know normally people use root.destroy() why is that?
Of course but it will terminate the entire program, including your app.
According to here: https://www.daniweb.com/programming/software-development/threads/66698/exit-a-tkinter-gui-program. root.destroy is a safe, dependable way to exit your Tkinter app. From the link:
destroy() just terminates the mainloop and deletes all widgets. So it seems to be safer if you call your app from another Tkinter app, or if you have multiple mainloops.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With