How to efficiently read binary files?

Grant Edwards grante at visi.com
Mon May 1 11:04:43 EDT 2006


On 2006-04-30, Robert Kern <robert.kern at gmail.com> wrote:
> Grant Edwards wrote:
>> On 2006-04-30, David Lees <debl2NoSpam at verizon.net> wrote:
>> 
>>>I want to process large binary files (>2GB) in Python.  I have played 
>>>around with prototypes in pure Python and profiled the code.  Most of 
>>>the time seems to be spent converting back and forth to and from strings 
>>>using the struct module.  Is there a way to directly read into an array 
>>>of integers in Python?
>> 
>> Perhaps the numarray module?
>
> numpy for new code, please.

So numarray and numpy were both written to replace numeric?

-- 
Grant Edwards                   grante             Yow!  I want to kill
                                  at               everyone here with a cute
                               visi.com            colorful Hydrogen Bomb!!



More information about the Python-list mailing list