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

Heather Coppersmith me at privacy.net
Mon Oct 27 08:03:36 EST 2003


On 27 Oct 2003 01:21:22 -0800,
schwerdy at web.de (schwerdy) wrote:

> 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.

"less" interacts with the user through /dev/tty.

Regards,
Heather

-- 
Heather Coppersmith
That's not right; that's not even wrong. -- Wolfgang Pauli




More information about the Python-list mailing list