我正在尝试获取从下拉菜单的列表中选择的值,但是出现此错误
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python36\lib\tkinter\__init__.py", line 1699, in __call__
return self.func(*args)
File "C:\Python36\lib\tkinter\__init__.py", line 3436, in __call__
self.__callback(self.__value, *args)
TypeError: changeInLymph() takes 0 positional arguments but 1 was given
我的代码是:
# dropDown options
def changeInLymph():
data = "you selected the option " + var10.get()
label10.config(text=data)
var10 = StringVar()
choices = ['bean', 'oval', 'round']
# set the default option
popupMenu = OptionMenu(f1, var10, *choices ).grid(row = 20, column =5)
Label(f1, text="Choose a dish").grid(row = 19, column = 5)
label10 = Label(f1).grid(row=21,column=1)
where i am doing wrong please help anybody.