On Tue, 06 Dec 2011 10:19:55 +0430, Sergi Pasoev wrote:

> I wonder if it is realistic to get a single key press in Python
> without ncurses or any similar library.

On Unix, you need to use termios.tcsetattr() to disable "canonical mode".
Otherwise, the tty driver will only pass data up to the application when
the user enters a newline or EOF.

If you do this, you also need to handle SIGTSTP and SIGCONT, restoring the
original terminal settings on SIGTSTP (typically generated by Ctrl-Z) and
restoring the application's setting on SIGCONT.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to