我有许多字段需要填写。但是其中一个我使用了下拉菜单,我不确定如何检索数据。对于输入字段,我只使用.get(),然后将它们粘贴到数组中。
OPTIONS = [
"What was my first pets name?",
"What was your favorite food as a child?",
"What was the make of your first car?",
"What is your mother's maiden name?"
]
variable = StringVar(fp_frame)
variable.set(OPTIONS[0]) # default value
w = OptionMenu(fp_frame, variable, *OPTIONS)
w.place(x=660,y=425,width = 240, height = 28)
这是我的下拉菜单的代码。
1条答案
按热度按时间w8rqjzmb1#
尝试查看this,因此使用以下代码:
这个有用吗?