原代码:
kssm= pyautogui.locateAllOnScreen('')
goto = pyautogui.center(kssm)
pyautogui.moveTo(goto,duration=1)
报错:
Traceback (most recent call last):
File "E:/Python/untitled1/venv/找到图片并移动.py", line 5, in
goto = pyautogui.center(kssm)
File "E:Pythonuntitled1venvlibsite-packagespyscreeze__init__.py", line 582, in center
return Point(coords[0] + int(coords[2] / 2), coords[1] + int(coords[3] / 2))
TypeError: 'generator' object is not subscriptable
报错代码:
return Point(coords[0] + int(coords[2] / 2), coords[1] + int(coords[3] / 2))



