I tried making a function to check if an image is displayed on the screen using PyAutoGui and came up with this:
def check_image_on_screen(image):
try:
pyautogui.locateCenterOnScreen(image)
return True
except:
return False
And it works fine, but PyCharm tells me I shouldn't leave except
bare. What is the problem with leaving it like this? Is there a more appropriate way of creating the same function?