Fortran array in python (f2py?)...

Scott David Daniels Scott.Daniels at Acm.Org
Sat Feb 14 21:39:33 CET 2009


tripp wrote:
> ... dump the arrays to a binary file (much faster than dumping it to a text) 
 > from the fortran program....
> 
> How well does python handle binary files?  Maybe I could skit the f2py
> all together if I can get python to read the fortran binary file...

Likely your best plan.  Look into the numpy external package, because
those arrays are _far_ superior for actual calculation.  With numpy you
can do array_1 + array_2 without requiring a Python loop.  I'm sure
it has a way to read in binary arrays of the various data types.

--Scott David Daniels
Scott.Daniels at Acm.Org



More information about the Python-list mailing list