2024-04-26 21:29:45 发布
网友
在使用pyautogui检查图像是否不是屏幕的一部分时,我尝试了以下方法:
a = True while a is True: a = pyautogui.locateOnScreen('image.png') print ("No this image.')
它似乎不太管用
正确的方法是什么?多谢各位
将其放入for循环以继续检查图像的存在,一旦图像消失,退出循环
for _ in range(100): time.sleep(1) a = pyautogui.locateOnScreen('image.png') if a == None: print ("No this image.') break
将其放入for循环以继续检查图像的存在,一旦图像消失,退出循环
相关问题 更多 >
编程相关推荐