【发布时间】:2012-11-21 19:14:20
【问题描述】:
我尝试在内存中加载一个文件:
import mmap
with open(path+fileinput+'example.txt', 'rb') as f:
fileinput = mmap.mmap(f.fileno(), 0, prot=mmap.PROT_READ)
当我运行代码时出现错误:
AttributeError: 'module' object has no attribute 'PROT_READ'
【问题讨论】:
-
你如何测试它给出的行数?