There may be another bug in this code:
pixel_color = pyautogui.pixel(x, y)
return pixel_color == expected_color
I spot that after I’ve read the pyautogui documentation. In the docs they say pyautogui.pixel(...)
doesn’t return a tuple but some special object of their sort. I can bet my entire money in my wallet that if you change the return ...
instruction into:
ret = pixel_color == expected_color
print(ret)
return ret
Then you will got in your terminal 50 lines with False
text (of course after you fix that IndentationError
)