Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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
You can’t perform that action at this time.