Tkinter and IDE's
Prabhu Ramachandran
prabhu at aero.iitm.ernet.in
Tue Nov 20 23:48:44 EST 2001
More information about the Python-list mailing list
Tue Nov 20 23:48:44 EST 2001
- Previous message (by thread): Tkinter and IDE's
- Next message (by thread): Tkinter and IDE's
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
>>>>> "DA" == Don Arnold <darnold02 at sprynet.com> writes: DA> def quit(): print "Hello, I must be going" # import sys # DA> sys.exit() root.quit() DA> root = Tk() widget = Button(root, text="Hello, event world", DA> command = quit) widget.pack() root.mainloop() Well, what happens when you remove the root.mainloop()? Your other errors will occur simply because of the way you have defined quit. Change it like so: >>> from Tkinter import * >>> root = Tk() >>> def quit(): ... print "Hello, I must be going" ... root.destroy() ... >>> widget = Button(root, text="Hello, event world", command = quit) >>> widget.pack() >>> # click on button >>> Hello, I must be going This should definitely work. prabhu
- Previous message (by thread): Tkinter and IDE's
- Next message (by thread): Tkinter and IDE's
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list