IDLE with Tk app

Randall Hopper aa8vb at vislab.epa.gov
Wed Apr 14 08:30:18 EDT 1999


1) A first test

   >>> from Tkinter import *
   >>> button = Button( None, text="Testing" )
   >>> button.pack()
   >>> button.mainloop()

   Works fine, so I close the button's window (click X - WM_DELETE event),
   but IDLE is still stuck in button.mainloop().

   The same test in the raw python interpreter causes it to return to the
   prompt.

2) I try to exit (File->Exit)

   "The program is still running; do you want to kill it?"

   I click OK.

   (and we're still in the interpreter with the program running.)

   Try again, same result.  So I kill the IDLE window.


Anything I'm doing wrong here?  

I'd guess this is related to IDLE also being a Tk app.  Is there a
work-around so Tk apps can be run as-is in IDLE?

Randall




More information about the Python-list mailing list