컴퓨터/Python

pyautogui 같은이미지가 나타날 때까지 sleep

풍경소리^^ 2019. 5. 23. 21:57
import pyautogui
import time

while True:
find_img = pyautogui.locateOnScreen('my_region.PNG')
if find_img==None:
print(find_img)
time.sleep(5)
else:
break

center = pyautogui.center(find_img)
print(center)