Open SuperSonyk opened 4 years ago
I have a script automatically detecting the pressed key and printing it but nothing gets printed until the enter key gets pressed
from getkey import getkey, keys
while True: key = getkey() print(key, end='')
edit: The problem only occurs when the print function has the end= part
You need to flush the stream. Try this: print(key, end='',flush=True)
print(key, end='',flush=True)
I have a script automatically detecting the pressed key and printing it but nothing gets printed until the enter key gets pressed
from getkey import getkey, keys
while True: key = getkey() print(key, end='')
edit: The problem only occurs when the print function has the end= part