writing tkinter optionmenu selection to file

150 views Asked by At

I am trying to write the selection of the optionmenu to a file, along with textbox entries. The textbox entries work just fine but i keep getting an error saying optionmenu has no attribute .get(). what else can i use?? thanks in advance :)

here is an example of one of my option menu's

Ehrs = OptionMenu(app, hrs, "0", "1", "2", "3", "4", "5", "6", "7", "8")
Ehrs.config(width=15)
Ehrs.grid(row=1, column=4, sticky=EW)

here is what im using to write to a file. The name and activity variables are textbox entries and do not throw errors. the other variables are optionmenu selections and i cannot figure out how to save/write them to a file.

def writeToFile():
    name = Ename.get()
    activity = Eactivity.get()
    hrs = Ehrs.get()
    minute = Eminute.get()
    whoHelped = EwhoHelped.get()
0

There are 0 answers