Skip to content

Instantly share code, notes, and snippets.

@lifeparticle
Created July 11, 2014 19:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lifeparticle/bbeabac49f185c7507fe to your computer and use it in GitHub Desktop.
Save lifeparticle/bbeabac49f185c7507fe to your computer and use it in GitHub Desktop.
#!/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