A
Antal Rutz
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.
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.