Re: Reading a keypress

2008-02-26 Thread Jeff Schwab
Dennis Lee Bieber wrote: > On Mon, 25 Feb 2008 17:48:21 -0800, Jeff Schwab <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: >> What about curses? >> >> http://docs.python.org/lib/module-curses.html >> http://adamv.com/dev/python/curses/ > > I don't consider needing a 3rd pa

Re: Reading a keypress

2008-02-25 Thread Jeff Schwab
Dennis Lee Bieber wrote: > On Mon, 25 Feb 2008 10:35:54 -0800 (PST), wyleu > <[EMAIL PROTECTED]> declaimed the following in > comp.lang.python: > >> I'm trying to read a single keypress on Linux but expect to have the >> programme running on Windows platform as well and find the mention in >> the

Re: Reading a keypress

2008-02-25 Thread Rolf van de Krol
wyleu wrote: > Aaah it doesn't work from idle but it does from the command line... > > You are right. You can't read STDIN from IDLE. There has been a topic about that before: http://groups.google.com/group/comp.lang.python/browse_thread/thread/9f9c90cfe52378fe -- http://mail.python.org/mail

Re: Reading a keypress

2008-02-25 Thread wyleu
Aaah it doesn't work from idle but it does from the command line... -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading a keypress

2008-02-25 Thread wyleu
> > A recipe that supposedly does this in a cross-platform > way:http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/134892 class _Getch: """Gets a single character from standard input. Does not echo to the screen.""" def __init__(self): try: self.impl = _GetchWi

Re: Reading a keypress

2008-02-25 Thread Mike Driscoll
On Feb 25, 12:35 pm, wyleu <[EMAIL PROTECTED]> wrote: > I'm trying to read a single keypress on Linux but expect to have the > programme running on Windows platform as well and find the mention in > the FAQ: > > import termios, fcntl, sys, os > fd = sys.stdin.fileno() > > oldterm = termios.tcgetatt

Reading a keypress

2008-02-25 Thread wyleu
I'm trying to read a single keypress on Linux but expect to have the programme running on Windows platform as well and find the mention in the FAQ: import termios, fcntl, sys, os fd = sys.stdin.fileno() oldterm = termios.tcgetattr(fd) newattr = termios.tcgetattr(fd) newattr[3] = newattr[3] & ~ter