I'm trying to automate a task using pyautogui in windows built on the Azure cloud. But when I disconnect the remote connection, the pyautogui process does not work. My code↓
import time
import pyautogui as pg
pg.hotkey('alt', 'tab') #This line and
for i in range(10):
pg.press(str(i)) #The processing of this line will not be executed.
time.sleep(1)
Is there any way to run pyautogui without a remote connection?
■Environment
Azure VM windows 10 python 3.9.7 PyAutoGUI 0.9.53
■Detail operation is below.
1. Run the my program on the cloud machine.
2. Disconnects the cloud machine while the program is running.
3. Reconnect and check the program's result.
4. Error log is below.
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.
But I tried [pg.FAILSAFE = True]. There is no error but results are not normal behavior.