How to efficiently read binary files?

Grant Edwards grante at
Mon May 1 17:04:43 CEST 2006

On 2006-04-30, Robert Kern <robert.kern at> wrote:
> Grant Edwards wrote:
>> On 2006-04-30, David Lees <debl2NoSpam at> 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
                                 colorful Hydrogen Bomb!!

More information about the Python-list mailing list