python 按行读取文件 ,网上搜集有N种方法,效率有区别,先mark最优答案,下次补充测试数据
with open('filename') as file: for line in file: do_things(line)
这是最佳方式,可以处理超大文件