# -*- coding: utf-8 -*- import os,re num = 0 for root, dis, files in os.walk('G:\\paopaoyu\\apps'): for fil in files: p = re.compile('\W*.py$') m = p.search(fil) if m: #print fil f = file(root + '\\' + fil) temp = 0 while True: line = f.readline() if len(line) == 0: break num += 1 temp += 1 print fil + '----' + str(temp) f.close() print num