mmap
mmap — Memory-mapped file support
Memory-mapped file objects behave like both bytearray
and like file objects. You can use mmap objects in most places where bytearray
are expected; for example, you can use the re
module to search through a memory-mapped file. You can also change a single byte by doing obj[index] = 97
, or change a subsequence by as