Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. input_filename = input('Enter input file name: ')
  2. output_filename = input('Enter output file name: ')
  3.  
  4. with open(input_filename, 'r') as f, open(output_filename, 'w') as w:
  5. number = 0
  6. for line in f:
  7. number += 1
  8. w.write('{:>4}> {}'.format(number, line))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement