我试着在内存中加载一个文件:
import mmap
with open(path+fileinput+'example.txt', 'rb') as f:
fileinput = mmap.mmap(f.fileno(), 0, prot=mmap.PROT_READ)
Run Code Online (Sandbox Code Playgroud)
当我运行代码时出错:
AttributeError: 'module' object has no attribute 'PROT_READ'
Run Code Online (Sandbox Code Playgroud)