loading file in memory using Python

若如初见. 提交于 2019-12-05 07:21:23

The PROT_READ and PROT_WRITE are Unix-specific. You're likely looking for:

mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)

The mmap page actually has different entries for Unix/Windows version.

I recently got the same error message with my test program mmap.py. Renaming my test program to something else (mmap_test.py) fixed the name collision that caused numpy's memmap.py to get when it executed 'import mmap'.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!