【发布时间】:2019-01-18 09:37:30
【问题描述】:
【问题讨论】:
标签: python python-3.x numpy io
【问题讨论】:
标签: python python-3.x numpy io
您可以对更大的文件使用缓冲,例如:
with open("bigfile.npy","r",buffering=1000) as f:
contents=f.read()
#do something with the fist n lines of file at a time
这不会完全打开整个文件,而只会打开您在缓冲 arg 中指定为整数的数量(您可以根据您正在使用的系统决定您想要什么)并且系统不会停止工作。
【讨论】: