Advertisement
furas

locate number with pyautogui

Mar 7th, 2017
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. #! python3
  2. import sys
  3. import pyautogui
  4.  
  5. # locate Power
  6. found = dict()
  7. for digit in range(10):
  8.     positions = pyautogui.locateOnScreen('digits/{}.png'.format(digit), region=(888, 920, 150, 40), grayscale=True)
  9.  
  10.     for x, _, _, _ in positions:
  11.         found[x] = str(digit)
  12.  
  13. # without indentions
  14. cols = sorted(found)
  15. value = ''.join(found[col] for col in cols)
  16. print(value)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement