Created
July 3, 2015 15:38
-
-
Save devendranaga/94364ee620be05042c7b to your computer and use it in GitHub Desktop.
counts the number of sloc (Github)
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
#!/usr/bin/python | |
import sys | |
import os | |
if len(sys.argv) != 2: | |
print sys.argv[0] + " " + "filename" | |
exit(0) | |
fd = open(sys.argv[1], "r") | |
count = 0 | |
for line in fd: | |
line = line.strip(' \n') | |
if len(line) > 0: | |
count = count + 1 | |
fd.close() | |
print " no of slocs " + str(count) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment