Skip to content Skip to sidebar Skip to footer

Difference Between .quit And .destroy On Tkinter

What is the difference between .quit and .destroy on Tkinter, they seem to do the same thing.

Solution 1:

.quit() causes mainloop to exit, but doesn't directly cause any widgets to be destroyed. However, if there's no code after calling mainloop then the script exits, and all widgets will be destroyed.

.destroy() will destroy a widget. If you destroy the root window then all other widgets will be destroyed and mainloop will stop.

Post a Comment for "Difference Between .quit And .destroy On Tkinter"