Skip to content

Instantly share code, notes, and snippets.

@tedheich
Created November 15, 2009 10:41
Show Gist options
  • Save tedheich/235149 to your computer and use it in GitHub Desktop.
Save tedheich/235149 to your computer and use it in GitHub Desktop.
Printing line numbers of a source file
import sys
counter = 0
for line in open(sys.argv[1],'r'):
counter = counter + 1
print counter, line,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment