print(pyautogui.locateCenterOnScreen('ts.png'))
如果被匹配的图片没有遮挡,代码能正常工作,如果匹配不到图片,就会报错
-------------------------------------------------------
C:\Users\fivemeat\AppData\Local\Programs\Python\Python37\python.exe D:/py-atuo/test.py
Traceback (most recent call last):
File "D:/py-atuo/test.py", line 4, in <module>
print(pyautogui.locateCenterOnScreen('ts.png'))
File "C:\Users\fivemeat\AppData\Local\Programs\Python\Python37\lib\site-packages\pyscreeze\__init__.py", line 300, in locateCenterOnScreen
coords = locateOnScreen(image, **kwargs)
File "C:\Users\fivemeat\AppData\Local\Programs\Python\Python37\lib\site-packages\pyscreeze\__init__.py", line 271, in locateOnScreen
retVal = locate(image, screenshotIm, **kwargs)
File "C:\Users\fivemeat\AppData\Local\Programs\Python\Python37\lib\site-packages\pyscreeze\__init__.py", line 255, in locate
points = tuple(locateAll(needleImage, haystackImage, **kwargs))
File "C:\Users\fivemeat\AppData\Local\Programs\Python\Python37\lib\site-packages\pyscreeze\__init__.py", line 249, in _locateAll_python
raise ImageNotFoundException('Could not locate the image.')
pyscreeze.ImageNotFoundException: Could not locate the image.
Process finished with exit code 1
---------------------------------------------------------------------
哪位好心人指点一下,这是何道理?
版本号:
【pyautogui === 0.9.41】
【pygetwindow === 0.0.1】
如果被匹配的图片没有遮挡,代码能正常工作,如果匹配不到图片,就会报错
-------------------------------------------------------
C:\Users\fivemeat\AppData\Local\Programs\Python\Python37\python.exe D:/py-atuo/test.py
Traceback (most recent call last):
File "D:/py-atuo/test.py", line 4, in <module>
print(pyautogui.locateCenterOnScreen('ts.png'))
File "C:\Users\fivemeat\AppData\Local\Programs\Python\Python37\lib\site-packages\pyscreeze\__init__.py", line 300, in locateCenterOnScreen
coords = locateOnScreen(image, **kwargs)
File "C:\Users\fivemeat\AppData\Local\Programs\Python\Python37\lib\site-packages\pyscreeze\__init__.py", line 271, in locateOnScreen
retVal = locate(image, screenshotIm, **kwargs)
File "C:\Users\fivemeat\AppData\Local\Programs\Python\Python37\lib\site-packages\pyscreeze\__init__.py", line 255, in locate
points = tuple(locateAll(needleImage, haystackImage, **kwargs))
File "C:\Users\fivemeat\AppData\Local\Programs\Python\Python37\lib\site-packages\pyscreeze\__init__.py", line 249, in _locateAll_python
raise ImageNotFoundException('Could not locate the image.')
pyscreeze.ImageNotFoundException: Could not locate the image.
Process finished with exit code 1
---------------------------------------------------------------------
哪位好心人指点一下,这是何道理?
版本号:
【pyautogui === 0.9.41】
【pygetwindow === 0.0.1】
