On Tuesday, December 6, 2011 11:22:18 PM UTC+8, Grant Edwards wrote:
> On 2011-12-06, Sergi Pasoev 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 w
On 2011-12-06, Sergi Pasoev 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
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 pas
On 6/12/11 09:48:39, Steven D'Aprano wrote:
On Tue, 06 Dec 2011 10:19:55 +0430, Sergi Pasoev wrote:
Hi.
I wonder if it is realistic to get a single key press in Python without
ncurses or
any similar library. In single key press I mean something like j and k
in Gnu less
program, you pres
On Tue, 06 Dec 2011 10:19:55 +0430, Sergi Pasoev wrote:
> Hi.
>
> I wonder if it is realistic to get a single key press in Python without
> ncurses or
> any similar library. In single key press I mean something like j and k
> in Gnu less
> program, you press the key and and
On Dec 6, 3:49 pm, Sergi Pasoev wrote:
> I wonder if it is realistic to get a single key press in Python
> without ncurses or any similar library.
It's possible using Tkinter in the standard library:
http://www.daniweb.com/software-development/python/code/216830
--
http://mail
On Tuesday, December 6, 2011 1:49:55 PM UTC+8, Sergi Pasoev wrote:
> Hi.
>
> I wonder if it is realistic to get a single key press in Python
> without ncurses or
> any similar library. In single key press I mean something like j and k
> in Gnu less
> program, you press
Hi.
I wonder if it is realistic to get a single key press in Python
without ncurses or
any similar library. In single key press I mean something like j and k
in Gnu less
program, you press the key and and it is captured by the script without need to
press enter afterwards
--
http