from Tkinter import * import sys def close(): sys.exit(0) root = Tk() button = Button(root) button['text'] = "Close" button['command'] = close button.pack() root.mainloop()