Skript that reads from Unix Pipe _AND_ interacts by getkey()

schwerdy schwerdy at web.de
Mon Oct 27 04:21:22 EST 2003


Greetings to all Python fans :-)

Is it possible to create a skript, that can read from a unix pipe
(eg.: "find -type f -name "*.ogg" | myscript.py"), _AND_ interact with
the user by waiting for keypress (eg.: getkey() funktion of a curses
screen)?

My tests failed: When I divert data via pipe to my skript and do
sys.stdin.read(), screen.getkey() always returns -1.

Has anyone an idea, how this issue can be solved? The "less" command
does exactly the same, so there should be a way.

Thanks in advance
Schwerdy




More information about the Python-list mailing list