tags:

views:

114

answers:

1

In Python using Tkinter, what is the difference between root.destroy and root.quit when closing the root window?

Is one prefered over the other? Does one release resources that the other doesn't?

+1  A: 

"quit() stops the TCL interpreter. This is in most cases what you want, because your Tkinter-app will also stop. It can be a problem, if you e.g. call your app from idle. idle is itself a Tkinker-app, so if you call quit() in your app and the TCL interpreter gets terminated, idle will also terminate (or get confused ).

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."

taken from http://www.daniweb.com/forums/thread66698.html

ErikT