I'm trying to print out the value selected in the option menu but only the first value gets printed everytime I run the code, even if I change my selection to b or c. Not sure where I'm wrong.This is my code:
from tkinter import *
window=Tk()
window.geometry("700x400")
options=StringVar(window)
options.set("a")
menu=OptionMenu(window,options, "a","b","c")
menu.grid(row=2,column=2)
selection=options.get()
print(selection)