Jun-27-2022, 02:00 PM
Here is an additional naive solution without using Exceptions:
import pyautogui coords = pyautogui.locateCenterOnScreen("your_image.png") # coords is None -> no result if coords is None: print("Could not locate the image") else: x, y = coords # tuple unpacking print(f"All fine, got the coordinates: {x} | {y}")
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!