Re: reading one byte from stdin

2008-07-16 Thread Fredrik Lundh
Mark McDuff wrote: I'm trying to read one byte from stdin, without the newline. If I try something like: >>> import os, sys >>> os.read(sys.stdin.fileno(),1) I can input a character, but then I have to press enter, which leaves a newline character in the stdin buffer and requires two keypre

Re: reading one byte from stdin

2008-07-16 Thread Diez B. Roggisch
Mark McDuff schrieb: I'm trying to read one byte from stdin, without the newline. If I try something like: >>> import os, sys >>> os.read(sys.stdin.fileno(),1) I can input a character, but then I have to press enter, which leaves a newline character in the stdin buffer and requires two keypr

reading one byte from stdin

2008-07-15 Thread Mark McDuff
I'm trying to read one byte from stdin, without the newline. If I try something like: >>> import os, sys >>> os.read(sys.stdin.fileno(),1) I can input a character, but then I have to press enter, which leaves a newline character in the stdin buffer and requires two keypresses. Is there any