import pyautogui import time time.sleep(3) # Gives you 3 seconds to switch to another window (e.g., a text editor) pyautogui.press(' ') # Sends a space pyautogui.press('space') # Sends another space