Created
July 11, 2014 19:07
-
-
Save lifeparticle/bbeabac49f185c7507fe to your computer and use it in GitHub Desktop.
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/env python | |
# beta | |
# Lisence Under GPL2 | |
# Author: S.Mahbub-Uz-Zaman | |
import fnmatch | |
import os | |
def count_lines(filePath): | |
f = open(filePath) | |
lines = sum(1 for line in f) | |
f.close() | |
return lines | |
def main(): | |
sum = 0 | |
for root, dirnames, filenames in os.walk('.'): | |
#if root.split(os.path.sep)[-1] == "Dropbox": | |
#print "dropbox" | |
#continue | |
for filename in fnmatch.filter(filenames, '*.java'): | |
sum += count_lines(os.path.join(root, filename)) | |
print 'whhhhat ',sum | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment