import pyautogui
image = pyautogui.locateOnScreen("image.png")
#Searches for the image
while image == None:
image = pyautogui.locateOnScreen("image.png")
print("still haven't found the image")
#When program finds image, print the location
print(image)
我知道这篇文章已经发布两年了,但是我发现这篇文章提出了同样的问题,而且提供的解决方案不适用于pyautoguiv0.9.41及更高版本。下面是我自己的:
来自pyautogui.readthedocs.io: 如果找不到映像,则返回映像的版本41.0。在
可以循环脚本:
相关问题 更多 >
编程相关推荐