Unbuffered keyboard input?

Grant Edwards invalid at invalid
Tue Jun 9 14:44:37 EDT 2009


On 2009-06-09, Ken D'Ambrosio <ken at jots.org> wrote:

> I need to have some non-buffered keyboard interaction with a Python script
> (on Linux).  Back in the day, I fired up Curses to do this in Perl.  Any
> idea if that's still how I have to fly?  Or is there a different
> mechanism?

Same as it ever was (in the order I'd probably try):

 1. You can switch stdin to raw mode using standard termios
    calls (just like in C).

 2. You can use ncurses.

 3. You can use some other UI library like newt/slang, wxWidgets, etc.

 4. You can shove long rusty needles through your eyeballs into
    your brain until you no longer want to do non-buffered
    keyboard interaction.

 5. You can make Xlib calls.

Once you've tried #5, #4 doesn't sound so bad...
 
-- 
Grant Edwards                   grante             Yow! Where's th' DAFFY
                                  at               DUCK EXHIBIT??
                               visi.com            



More information about the Python-list mailing list