Reading fortran 'unformatted' binary files

Travis Oliphant olipt at
Mon May 8 02:42:27 EDT 2000

> I'm sure this has been asked before, but I can't seem to find any
> information on deja or on the web. How can I get python (with Numpy) to read
> in arrays from a file created from a fortran code? I've looked at a package
> called numpy-signaltools, but the RPM seems to be missing a number of files
> (so it doesn't work). Anybody have any simple solutions?

What problems with the RPM are you having?   Are you compiling or
installing a binary?  I made the RPM and the package and have used it
successfully for many months.  There may be installation wrinkles which
have not been ironed out.

In numpy-signaltools is a class called mIO that uses numpy and the struct
module to read and write Fortran records (fortread and fortwrite methods)
directly, if the Fortran follows the common convention of starting and 
ending each record with the number of bytes in the record.



More information about the Python-list mailing list