garabik:
> what about:
>
> for line in sys.stdin:
> process(line)
This does not meet the OP's requirement, which was
>> 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).
It's a sub
Antal Rutz <[EMAIL PROTECTED]> wrote:
> 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).
>
what about:
for line in sys.stdin:
process(li
OK, it was really a newbie thing:
import sys
while True:
line = sys.stdin.readline()
process(line)
sorry.
--
--arutz
--
http://mail.python.org/mailman/listinfo/python-list
Maybe I've found a poorman's one:
import sys
while True:
try:
line = sys.stdin.readline()
except:
sys.stdin.seek(0)
else:
process(line)
Antal Rutz wrote:
> Hi!
>
> Maybe a very newbie question but:
> I'd like to write a prog which reads one line at a time on
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-lik