Here\'s the code that I\'m trying to run:
import pyautogui
r=pyautogui.locateOnScreen(\'C:\\Users\\David\\Desktop\\index.png\',grayscale=False)
print r
The locateOnScreen()
function returns None
if the image wasn't found on the screen. Remember, the match has to be pixel-perfect in order to match it, so be sure to crop index.png to the smallest recognizable size to prevent extra details from ruining your match. Also, make sure the thing you are looking for is not obscured by any other windows on top of it.