Jump to content

Read a file line by line: Difference between revisions

Line 3:
 
=={{header|Python}}==
For sthethe simple case of iterating over the lines of a file you can do:
<lang python>with open("foobar.txt") as f:
for line in f:
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.