Jeff Epler wrote:
> The iterator for files is a little bit like this generator function:
>
Cool thanks for that, it looks like iter(f.readline, '') is the best
solution for the job.
Tom
--
http://mail.python.org/mailman/listinfo/python-list
I'm not new to Python, but I didn't realise that sys.stdin could be called
as an iterator, very cool!
However, when I use the following idiom:
for line in sys.stdin:
doSomethingWith(line)
and then type stuff into the program interactively, nothing actually happens
until I hit CTRL-D.