代码行统计工具
来源:互联网 发布:香港恐怖在线知乎 编辑:程序博客网 时间:2024/06/09 19:04
统计h/c/cpp/cc/代码,Python写的,只是统计了行数,没有区分空行,注释等
- #! /usr/bin/python
- # coding=utf-8
- import os,sys
- def getCount(dr):
- c = 0
- for l in os.listdir(dr):
- p = dr + '/' + l
- if os.path.isdir(p):
- c += getCount(p)
- if os.path.isfile(p):
- if l.endswith('.h') or /
- l.endswith('.c') or /
- l.endswith('.hpp') or /
- l.endswith('.cpp') or /
- l.endswith('.cc'):
- t = len( open(p,'r').readlines() )
- print p,t
- c += t
- return c
- if __name__=="__main__":
- dr = sys.argv[1]
- print getCount(dr)
自己这三年来,写的C/C++代码正文处理的代码有3万行,写的应用服务器近2万行,加起来也有5万行了;同时,python代码1万多行。平均到每个工作日将近80行,还行。
0 0
- 代码行统计工具
- 代码行统计工具
- 代码行统计工具(python)
- 代码行统计工具V1.5
- 代码行统计工具V2.0
- 代码行统计工具V2.5
- 代码行统计工具 SourceCounterCN简介
- 代码行统计工具(C#)
- 代码行数统计工具
- java代码统计工具
- 代码统计工具
- 代码统计工具
- java代码统计工具
- 代码统计工具cloc
- sloccount 代码统计工具
- 代码行数统计工具
- 代码统计工具statsvn
- java代码统计工具
- Java数组类型
- android 获取网络类型的方法
- jQuery 插件autocomplete 应用
- Flume环境部署和配置详解及案例大全
- 优先队列详解
- 代码行统计工具
- easyui datagrid editor在编辑状态下更新列值并不结束编辑。
- [Java]将二叉树的左右子树交换 非递归实现
- android之android.intent.category.DEFAULT的用途和使用 隐式Intent
- 欢迎使用CSDN-markdown编辑器
- htm tt cite em u
- 查找和添加功能声明
- What is Retransmission, ARQ and HARQ?
- 飛飛(七十二)阅读 STL中的简单容器和迭代器