Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # -*- coding: utf-8 -*-
- from time import sleep
- from pyautogui import press
- class KeyPresser:
- def __init__(self, key='j', interval=1):
- self.key = key
- self.interval = interval
- def press_key(self):
- press(self.key)
- def run(self):
- while True:
- self.press_key()
- sleep(self.interval)
- if __name__ == "__main__":
- key_presser = KeyPresser()
- key_presser.run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement