msvcrt.hbhit() and msvcrt.getch() in Wing Pro 8 on Windows 10
Hi, I am using Wing Pro 8 on Windows 10. My Python scripts use mscvrt package for hbhit() and getch(). I can get input characters without them being printed on the screen. They work fine in Windows Command window be behave differently in Wing Pro 8. Here is a test script:
import msvcrt
import time
while True:
while msvcrt.kbhit() == 0:
time.sleep(0.1)
print('getting ch')
c = msvcrt.getch()
print(f'input: {c}')
if c==b'e':
exit()
When running in debug mode, msvcrt.kbhit() always returns zero and msvcrt.getch() never returns. Could it be fixed? Thank you.
Comments