摘要: 题目:计算给出代码中注释、代码、空行的行数来源:网络思路:注释行以 ‘#’开头,空行以 ‘\n’ 开头,以此作为判断def count_linenum(fname): fobj = open(fname,"rU") #print fobj.readlines() count_bla... 阅读全文
posted @ 2015-10-26 17:28 laclt 阅读(251) 评论(0) 推荐(0) 编辑
摘要: # -*- coding: cp936 -*-#转载源于:http://blog.csdn.net/houyj1986/article/details/21196027#计算文件行数#1、文件比较小:fobj = open(r"C:\test.txt",'rU')len_fobj = len(fob... 阅读全文
posted @ 2015-10-26 16:03 laclt 阅读(821) 评论(0) 推荐(0) 编辑