Wrap a command in a function : Action : Tkinker PYTHON TUTORIALS


PYTHON TUTORIALS » Tkinker » Action »

 

Wrap a command in a function


Wrap a command in a function
from Tkinter import *
     
def quit():                                  
    print 'Hello, I must be going...'        
    import sys; sys.exit() 
     
widget = Button(None, text='Hello event world', command=quit)
widget.pack()
widget.mainloop()



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Tkinker
» Action