最近需要统计一下项目中代码的总行数,写了一个Python小程序,不得不说Python是多么的简洁,如果用Java写至少是现在代码的2倍。 [code] import os path=”/Users/rony/workspace/ecommerce/ecommerce/hot-deploy/” global totalcount totalcount =0 def cfile (path): allfiles = os.listdir(path) for file in allfiles: child = os.path.join(path,fil