File: oneline.py

package info (click to toggle)
diveintopython3 20110517%2B77958af-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,104 kB
  • sloc: python: 2,201; xml: 189; makefile: 45
file content (5 lines) | stat: -rw-r--r-- 206 bytes parent folder | download | duplicates (3)
1
2
3
4
5
line_number = 1
with open('examples/favorite-people.txt', encoding='utf-8') as a_file:
    for a_line in a_file:
        print('{:>4} {}'.format(line_number, a_line.rstrip()))
        line_number += 1