[Tkinter-discuss] Running GUI from console and quitting it

Amit Finkler amit.finkler at gmail.com
Wed Jan 30 10:54:40 CET 2008


Hi all,


I wrote a short code in Python in which I check some boolean flag. If
it's true, everything is OK. If it's false, I wanted it to pop-up a
warning message on the user's screen. To implement this with Tkinter I
naively tried to use tkMessageBox:


 tkMessageBox.showwarning(
                "Output check",
                "Output is not on")


However, once the user presses the OK button, the root Tk() window
remains. Note that in no place in the code did I create a Tk() instance.
The only Tkinter instance is the MessageBox.


Is it possible to run some console-based script which pops-up a GUI
window and then by pressing OK just kill/destroy it?


Thanks,


Amit.



More information about the Tkinter-discuss mailing list