计算某一个文件的行数
[python]#_*_coding:utf_8_import sysimport os'''''计算某一个文件的行数'''def countFileLines(filename):count = 0try:handle = open(filename, 'r')for eachline in handle:count += 1except IOError, e:print 'file open error', eprint countreturn countcountFileLines('D:/study/practice/algorithm/sort.cpp')
补充:Web开发 , Python ,