tail -f sys.stdin

Antal Rutz arutz at mimoza.pantel.net
Thu Jun 9 07:46:33 EDT 2005


Hi!

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.

Thanks.

-- 


--arutz



More information about the Python-list mailing list