-
-
Save 0x9900/3ff3d4a05b9e5062bff871693772ed18 to your computer and use it in GitHub Desktop.
Example of mmap use.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from mmap import ACCESS_READ, mmap | |
| with open(filename, 'rb') as f, mmap(f.fileno(), 0, access=ACCESS_READ) as mm: | |
| for byte in mm: # length is equal to the current file size | |
| # Do stuff with byte |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment