[Idle-dev] Interruptable code?

Douglas S. Blank dblank at brynmawr.edu
Sat Dec 16 16:59:49 CET 2006

On Sat, December 16, 2006 10:15 am, Tal Einat said:


>  This always works for me:
> import thread
> import Tkinter
> root = Tkinter.Tk()
> ...
> thread.start_new_thread(root.mainloop, ())
> This way you can even kill the mainloop without killing IDLE.
> Hooking onto IDLE's GUI mainloop isn't a very good option IMO. It's very
> useful when you're debugging IDLE itself, but otherwise it's a source
> of inconsistent behavior and weird bugs.

Thanks, that's useful. But it isn't really an option for teaching Intro to
CS. It would be nice if Tkinter worked this way if it were started up from
inside idle. Given that I don't want to introduce this kind of complexity,
I guess I can either use Zelle's library or use "idle -n".

Thanks again,


Douglas S. Blank
Associate Professor, Bryn Mawr College
Office: 610 526 601

More information about the IDLE-dev mailing list