tail -f sys.stdin

Antal Rutz arutz at mimoza.pantel.net
Thu Jun 9 13:46:33 CEST 2005


Maybe a very newbie question but:
I'd like to write a prog which reads one line at a time on its sys.stdin
and immediately processes it.
If there are'nt any new lines wait (block on input).

I couldn't find a solution for it.
Several methods that doesn't fit here:
- reading the entire file-like object until EOF and then process
- read one line(all lines) and when there aren't any lines more, quit.

So I need a 'tail -f' for stdin.




More information about the Python-list mailing list