Tkinker Python Tutorial

from Tkinter  import *
     
class HelloCallable:
    def __init__(self):                      
        self.msg = 'Hello __call__ world' 
    def __call__(self):
        print self.msg                       
        import sys; sys.exit()               
     
widget = Button(None, text='event', command=HelloCallable())
widget.pack()
widget.mainloop()