任何人都有一个想法,为什么下面的代码会产生错误?从func返回2个值
我叫FUNC获得鼠标坐标:
def button_click(event):
x, y = event.x, event.y
print('{}, {}'.format(x, y))
return x, y
,然后我要分配的结果,新的变量在主:
x_cord, y_cord = app_root.bind('<ButtonRelease-1>', button_click)
通过这样做,我得到以下错误:
"x_cord, y_cord = app_root.bind('<ButtonRelease-1>', button_click)
ValueError: too many values to unpack"
任何人都有一个想法,为什么发生这种情况?谢谢大家!
你没有缩进? – putvande
'app_root.bind'返回什么? – max
你能提供完整的堆栈跟踪吗? –