Anonymous user
Read a file line by line: Difference between revisions
m
→{{header|Python}}: Whoops.
(→{{header|Tcl}}: Add Python.) |
m (→{{header|Python}}: Whoops.) |
||
Line 2:
The task is to demonstrate how to read a file line by line (as opposed to [[Read entire file|reading the entire file]]).
=={{header|
For sthe simple case of iterating over the lines of a file you can do:
<lang python>with open("foobar.txt") as f:
|