"Jia,Lu" <[EMAIL PROTECTED]> writes:
> Hi all
> I write a program to detect key press,but , why there is a *space*
> before the character I typed.??
There is none. The output I see when I type 1 2 q is:
->1
->2
->q
If that is what you see, the problem is in your
print "->%s"%ch
statement. It implicitly outputs '\n' at the end, and when terminal is
set in raw mode, this is not translated into '\r\n' as when terminal is
in canonical mode.
Try
print "->%s\r" % ch
or just
sys.stdout.write(ch)
-- Sergei.
--
http://mail.python.org/mailman/listinfo/python-list