On Mar 18, 3:05 pm, Grant Edwards <gra...@visi.com> wrote:
> {snip] ... If it
> only going to be used once, then just do the usual thing:
>
> f = open(...)
> while True:
>    buf = f.read()
>    if not buf: break
>    # whatever.
> f.close()

+1

That's the canonical way (maybe using "with ... as" nowadays).  Surely
everything else is simply overkill, (or unwarranted cleverness) here.
In any case this is what most practising pythonista would comprehend
instantly.

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to