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)

猜你喜欢

转载自www.cnblogs.com/buxizhizhoum/p/9020990.html