Use open() to obtain a file-like object for reading, writing, or appending. Its optional mode combines r, w, or a with b for binary access; r is the default. section 6.3
Choose an access pattern:
- Iterate directly over the returned object; each iteration provides the next line, including its newline character. section 6.3
Read a file line by line
with open(filename) as f: for one_line in f: print(len(one_line))








