def findfiles(dir): res=[] res1=[] files=os.listdir(dir) py_files=grep.greps('.py',files) py_files1=grep.readfiles(py_files) for i in py_files1: res.append(i) print "total lines of code in %s is :"%dir, return len(res)
def findfiles(dir): res = [] res1 = [] files = os.listdir(dir) py_files = grep.greps(".py", files) py_files1 = grep.readfiles(py_files) for i in py_files1: res.append(i) print "total lines of code in %s is :" % dir, return len(res)
def findfiles(dir): res=[] res1=[] files=os.listdir(dir) py_files=grep.greps('.py',files) py_files1=grep.readfiles(py_files) for i in py_files1: res.append(i) for i in res: if (i[0]!='#'and i[0]!=' """ ' and i[0]!='\n'): # i=i.strip('\n') res1.append(i) print "total lines of code in %s is :"%dir, print len(res) print "total no.of lines after stripping command lines is:", return len(res1)
def printlines(filenames): read=grep.readfiles(filenames) for i in read: if len(i)>40: print i
def printlines(filenames): read = grep.readfiles(filenames) for i in read: if len(i) > 40: print i