python 读取文件

python 一次读取多行

with open(filename, "r") as f:
    lines = f.readlines(LINE_BATCH)
    while lines:
        for line in lines:
            print line
        lines = f.readlines(LINE_BATCH)
原文地址:https://www.cnblogs.com/buxizhizhoum/p/9020990.html