I created this tkinter dropdown window where I select an option. After I choose that I press Ok and the option gets printed. How can I close this tkinter window after pressing the 'Ok' button?
from tkinter import *
OPTIONS = [
"Physician 1",
"Physician 2",
"Physician 3"
]
master = Tk()
variable = StringVar(master)
variable.set(OPTIONS[0]) # default value
w = OptionMenu(master, variable, *OPTIONS)
w.pack()
def ok():
physician_name=variable.get()
print (physician_name)
button = Button(master, text="OK", command=ok)
button.pack()
mainloop()