Single key press
88888 Dihedral
dihedral88888 at googlemail.com
Tue Dec 6 10:38:15 EST 2011
On Tuesday, December 6, 2011 11:22:18 PM UTC+8, Grant Edwards wrote:
> On 2011-12-06, Sergi Pasoev <s.pa... at gmail.com> wrote:
>
> > I wonder if it is realistic to get a single key press in Python
> > without ncurses or
> > any similar library.
>
> Yes. Just put the tty associated with stdin in raw mode and make
> single byte read() calls on it. Remember to restore the tty settings
> when your program exits.
>
> --
> Grant Edwards grant.b.edwards Yow! World War III?
> at No thanks!
> gmail.com
Cheers to virus scan software that has to scan fast and easily for all files
under a drive. Easy clean up in APPS.
More information about the Python-list
mailing list