Read one key press.

Martin Pool martinp at mincom.com
Mon Oct 18 23:28:22 EDT 1999


Gerrit Holl wrote:
> Hmm. I think curses is the module I need, but I can't find documentation and
> the module is written in c so I can't read that. If I run your example, I get
> Traceback (innermost last):it:~/oefen/python$ python modcurse.py
>                              File "modcurse.py", line 6, in ?
>                                                                  key = curses.getch()
>      AttributeError: getch
>                           20:17:46:17/516:gerrit at gerrit:~/oefen/python$
> and my terminal is totally wrong (if I press enter I don't get a newline, etc.)

If you get into this state by breaking a curses program you can usually
fix it by typing 

  reset [enter]

which gets your terminal back to a sane state.  (It doesn't reset the
machine, or anything like that.)  This often works even if you can't see
your keypresses echoed back: it's getting to the shell anyhow.

-- 
 /\\\  Mincom | Martin Pool          | martinp at mincom.com
// \\\        | Software Engineer    | Phone: +61 7 3303-3333
\\ ///        | Mincom Ltd.          | 
 \///         | Teneriffe, Brisbane  | Speaking for myself only




More information about the Python-list mailing list