Created
November 15, 2009 10:41
-
-
Save tedheich/235149 to your computer and use it in GitHub Desktop.
Printing line numbers of a source file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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