Skip to content

Instantly share code, notes, and snippets.

@kisst
Last active October 3, 2022 13:14
Show Gist options
  • Save kisst/074894573cea7f4e697c08337b5c4deb to your computer and use it in GitHub Desktop.
Save kisst/074894573cea7f4e697c08337b5c4deb to your computer and use it in GitHub Desktop.
One directional VDI proof "copy/paste"
#!/usr/bin/env python3
"""
Type the content of the file given in parameter
"""
import time
import sys
import pyautogui
# validate that we have something to type
if not len(sys.argv) == 2:
print("Error, no filename given or too many parameters")
print(len(sys.argv))
sys.exit()
# give a chance for the user to change window
for cv in range(3, 0, -1):
print(cv)
time.sleep(1)
print("Typing away...")
# main loop
with open(sys.argv[1]) as f:
lines = f.readlines()
for line in lines:
pyautogui.typewrite(line)
print("Done")
@kisst
Copy link
Author

kisst commented Oct 3, 2022

For the way back just use normcap https://github.com/dynobo/normcap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment