I provided this answer because Keith’s, while succinct, doesn’t close the file explicitly
with open("log.txt") as infile:
for line in infile:
do_something_with(line)
I provided this answer because Keith’s, while succinct, doesn’t close the file explicitly
with open("log.txt") as infile:
for line in infile:
do_something_with(line)