import sys from Tkinter import * widget = Button(None, text='Hello', command=sys.exit) widget.pack() widget.mainloop()