I have been trying to receive input in a way that won't stuck my program (msvcrt
instead of recv). Yet, my program isn't working and I'm having trouble understanding why.
I tried writing a code (that somehow works on my friend's computer, but not on mine).
import msvcrt
print ("enter something")
line = b""
while True:
ch = msvcrt.getwch()
print "2"
if ch == b'\r':
print (line.decode('latin-1'))
break
line = line + ch
print (ch.decode('latin-1'))