Exiting Tkinter when using IDLE

Gerrit Muller gerrit.muller at embeddedsystems.nl
Fri Mar 12 08:14:24 CET 2004


Jason Harper wrote:

> You have two issues here:
> 
> 1. Don't use the quit method, instead just close your window.  Your QUIT
> button could perhaps use:
> 	command=self.destroy
> 
> 2. Don't call mainloop() if IDLE already has one running.  Try this:
> 
> import sys
> if "idlelib" not in sys.modules:
> 	root.mainloop()
> 
> 	Jason Harper

I think that this answer deserves a place in a cookbook recipe. I did 
not work with Tkinter for more than a year, but I remember that I 
struggled with exactly the same issues and more or less experimentally 
reached this solution.

thanks for the clarification!

regards Gerrit

-- 
Gaudi systems architecting:
http://www.extra.research.philips.com/natlab/sysarch/




More information about the Python-list mailing list