listing11-8.py 118 B

12345
  1. with open(filename) as f:
  2. while True:
  3. line = f.readline()
  4. if not line: break
  5. process(line)