Strange terminal behavior after quitting Tkinter application

Hamilton, William whamil1 at entergy.com
Mon May 7 10:02:14 EDT 2007


> From: Chris
> >         I'll admit to being surprised at seeing a claim that a
tkinter
> > application, started within an interactive session, without a
mainloop,
> > even runs... I could see it maybe happening from Idle, since Idle is
> > running a tkinter mainloop, so the application bindings may have
just
> > become "added widgets" to the Idle loop (but of course, a second
> > mainloop would conflict heavily).
> 
> You can try by building a working Tkinter GUI interactively from the
> standard Python interpreter, and see that the GUI works (i.e.
> processes events) at the same time.
> 


If you build it as a class (such as the code in Chris's original post)
it works; if you do it all directly, nothing happens until you run
mainloop().  It works, but I'm not sure that it was intended to work
that way.  I think your problem is related to that difference.

You'll probably be better off creating a new interpreter window as part
of your program, if you really need access to the interpreter alongside
your GUI.  You may be able to extract IDLE's interpreter window and use
it directly.


---
-Bill Hamilton



More information about the Python-list mailing list