Created
May 22, 2023 06:49
-
-
Save dceoy/1a877a4d6f16d77f09741e3fdc8282eb to your computer and use it in GitHub Desktop.
[Python] Press a key using PyAutoGUI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import signal | |
import time | |
import pyautogui | |
def press_esc_repeatedly(waiting_sec=300, pressed_key='esc'): | |
signal.signal(signal.SIGINT, signal.SIG_DFL) | |
while True: | |
pyautogui.press(pressed_key) | |
time.sleep(waiting_sec) | |
if __name__ == '__main__': | |
press_esc_repeatedly() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment