Reading character from keyboard
Gabriel Genellina
gagsl-py at yahoo.com.ar
Tue Jan 23 13:56:12 EST 2007
At Tuesday 23/1/2007 15:28, consmash at gmail.com wrote:
> > A very simple question. I would like to read a single character from the
> > keyboard (y or n). I have tried to look in my Python books and a google
>
>Actually, if you want to read only one character from keyboard, you
>will need to use terminal operations rather than plain input stream.
>Unfortunately this is rather not portable solution. For Windows you
>have to import msvcrt, on Unices curses module. The latter code is
There is a portable getch implementation, search the Python Cookbook.
--
Gabriel Genellina
Softlab SRL
__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!
http://www.yahoo.com.ar/respuestas
More information about the Python-list
mailing list