说明:python 统计代码行数简单实例
送测的时候,发现需要统计代码行数
于是写了个小程序统计自己的代码的行数。
#calclate_code_lines.py
import os
def afileline(f_path):
res = 0
f = open(f_path)
for lines in f:
if lines.split():
res += 1
return res
if __name__=='__main__':
host = 'E:' <weixin_38623919> 上传 | 大小:29kb