python 统计文本文件的行数

num_lines = sum(1 for line in open(input_file_name))

posted @ 2014-08-02 10:34  emanlee  阅读(3898)  评论(0编辑  收藏  举报