Is it possible?: cat text.txt | python_script_which_also_gets_user_input.py

Hans Dembinski barross at web.de
Sat Sep 4 14:18:38 EDT 2004


Hi there,

I run in a problem with a script, that shall work similar like the c-program
"most". It should be able to get some text on execution via a pipe but also
is interactive by the user via the curses module (for scrolling and stuff).
The problem is: if you call the script like that, you connect stdin to
text.txt and any later keyboard input is ignored, since curses also reads
from stdin.
I have the rather blurry impression that this could be possible with
threading or forking inside the script, but I nether did things like that
before and am hopeful to get some cool advice from you experienced
guys. :-)



More information about the Python-list mailing list