python 代码收藏
摘要:简易计算小文本文件的行数fobj=open(filepath,mode)count=fobj.readlines()print count即可对文件如果过大的话,需要另外写脚本return max(len(x.strip()) for x in open( filepath))f=open(filename,mode)alllines=(len(x.strip()) for x in f)f.closed()列表解析实例 http://www.cnblogs.com/wanpython/archive/2010/07/28/1787327.html讨论python的数据类型的区别http://
阅读全文
posted @ 2013-01-09 17:29
浙公网安备 33010602011771号