Created
October 26, 2016 09:46
-
-
Save MarcScott/2db5ba20c4f51945b56ee2f73a555a3b to your computer and use it in GitHub Desktop.
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
# Need to install the following | |
# sudo apt-get install xautomation | |
from subprocess import Popen, PIPE | |
from time import sleep | |
enter_sequence = '''key Return | |
''' | |
def keypress(sequence): | |
b = sequence.encode('utf-8') | |
p = Popen(['xte'], stdin=PIPE) | |
p.communicate(input=b ) | |
while True: | |
keypress(enter_sequence) | |
sleep(5) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment