Peter

Yes, you can even write

f = open("data.txt")
for line in f:
    # do stuff with line
f.close()

This has the additional benefit of not slurping in the entire file at once.

Is there disk access on every iteration? I'm guessing yes? It shouldn't be an issue in the vast majority of cases, but I'm naturally curious :)


thx
Caleb


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

Reply via email to