mmap interface in Python
David Ascher
da at ski.org
Fri Sep 10 12:44:16 EDT 1999
On 10 Sep 1999, Hrvoje Niksic wrote:
> When discussing Python speed, many people advised me to "slurp the
> whole file in". The only reason why I didn't like that is the obvious
> one -- it burns a lot of memory for large files.
>
> But then I remembered: in C under Unix, I would use mmap() to map the
> file to memory, and operate on that memory. I don't see why the same
> thing couldn't be available in Python -- under Unix at least.
>
> To do this, I'd need a `mmap' module that provides a `mmap' function.
> The usage would be something like:
ftp://starship.python.net/pub/crew/amk/new/
(alas, the FTP server is currently broken -- but that's where it will be).
--david ascher
PS: If you're impatient, let me know -- I have an older version somewhere.
More information about the Python-list
mailing list