So, I was just messing around with pyautogui moving the mouse to random positions on the screen, when I manually moved the mouse to the top left corner of the screen and ran the program, it raised a pyautogui failsafe
.
I do know how to disable it and all that, but I want to know why is is there in the first place and possible use cases
Code:
import pyautogui
pyautogui.click(x=25, y=1048)
time.sleep(2) # I moved the move to the corner of the screen during this time delay
pyautogui.click(x=701, y=430)
Error:
Traceback (most recent call last):
File "C:\1 Files and Folders\folder\Python Project\Python\CODE\My Projects\Automation.py", line 23, in <module>
job()
File "C:\1 Files and Folders\folder\Python Project\Python\CODE\My Projects\Automation.py", line 18, in job
pyautogui.click(x=1475, y=141)
File "C:\Users\My_user\AppData\Local\Programs\Python\Python39-32\lib\site-packages\pyautogui\__init__.py", line 585, in wrapper
failSafeCheck()
File "C:\Users\My_user\AppData\Local\Programs\Python\Python39-32\lib\site-packages\pyautogui\__init__.py", line 1710, in failSafeCheck
raise FailSafeException(
pyautogui.FailSafeException: PyAutoGUI fail-safe triggered from mouse moving to a corner of the screen. To disable this fail-safe, set pyautogui.FAILSAFE to False. DISABLING FAIL-SAFE IS NOT RECOMMENDED.