I am trying to use getch
of python to get the key the user pressed, but without pressing anything it is returning " b'\xff'
", and if I use ord(getch())
, it returns 255. If I can help thank you.
from msvcrt
import getch key = msvcrt.getch()
print(getch())
if key == 0:
quit()
elif key == 1:
print("Game inicado")
else:
print('Opção invalida!')