流式读取文件

GO 利用bufio包(流式操作) - 并发写文件/读文件示例_bufio.newwriter_dreamer'~的博客-CSDN博客 https://blog.csdn.net/qq_37102984/article/details/123009654

fn = "D:\\迅雷下载\\export_0.csv"
m,id_lst=1000,[]
with open(fn, 'r', encoding='utf-8') as fr:
while not fr._finalizing and m:
line = fr.readline()
print(line)
lst=line.split("\t\t\t")
id_lst.append(lst[1])
m-=1

 

 

 

 

 

posted @ 2023-03-28 19:59  papering  阅读(33)  评论(0编辑  收藏  举报