How to speed up reading bytes from file?

Skip Montanaro skip at pobox.com
Fri Dec 6 11:32:21 EST 2002


    Brad> I have a binary file that consists of variable length
    Brad> "elements". I need to scan over the file, reading in elements,
    Brad> seeking over some elements, etc.

    Brad> I do not want to load the entire file into memory.

Have you tried the mmap module?  Should work on Windows and Unix.

-- 
Skip Montanaro - skip at pobox.com
http://www.mojam.com/
http://www.musi-cal.com/




More information about the Python-list mailing list