1try:
2 import Tkinter as tk
3except:
4 import tkinter as tk
5
6root = tk.Tk()
7root.geometry("100x50")
8
9def close_window():
10 root.destroy()
11
12button = tk.Button(text = "Click and Quit", command = close_window)
13button.pack()
14
15root.mainloop()
16