当我尝试在python项目中单击按钮时,会得到一个错误,当您单击按钮时,它应该返回一个使用名为nflgame的包的每场游戏的平均得分列表,但是当您单击按钮时,它只会给出这个错误
Traceback (most recent call last):
File "C:\Users\Developer\workspace2\test2\main.py", line 16, in methods
for(y, t, w, h, a), info in schedule_games:
ValueError: too many values to unpack
这里是除了GUI之外我唯一拥有的类:
^{pr2}$
假设您使用的模块是the one linked by @gurka,那么{}是一个字典,所以循环应该是(假设Python 3.x,而不是2.x):
文档没有说明year的值是字符串还是数字,如果是前者,则必须使用
if int(info['year']) == 2013
。在此错误说明列表的长度与建议的变量列表不同。尝试在for循环之前打印列表,您将看到导致错误的原因。在
你需要把 打印(预定游戏) 就在for循环之前。在
相关问题 更多 >
编程相关推荐