import pyautogui import random from time import sleep while True: # Wait for a random interval between 1 and 6 minutes wait_time = random.randint(10, 150) # 60 seconds * (1 to 6 minutes) print(f"Waiting {wait_time} seconds.") sleep(wait_time) print("Pressing and key!") # Press the Enter key pyautogui.press("enter") # Press the Backspace key immediately after pyautogui.press("backspace")