[Tutor] Running and passing variables to/from Fortran

Andreas Kostyrka andreas at kostyrka.org
Sun May 6 11:51:43 CEST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Simple is the wrong idea. But I'd guess that you can access your Fortan
from C. If so, Pyrex provides a C-for-Python-coder tool. OTOH, just
reading the stuff in Python might be simpler than doing all the
interfacing. (I presume that you are just reading the data. If you have
verified working numeric code in Fortran, it's probably worthwhile to
interface with it instead of porting it).

Andreas

John Washakie wrote:
> I have a FORTRAN program which reads in unformatted sparse matrix
> data. Rather than rewriting the code in Python, I was hoping there is
> a way to call the Fortran program, passing filename variables TO
> Fortran, and returning the data (which is an array) back to my .py
> code for use there.
> 
> Is there a simple example of this that someone knows of?
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGPaUvHJdudm4KnO0RAtj2AJ9qqOxK0IxompMORJLEz7x62M8GSACdFSj/
kMxIV3hwO8eMPYG1FhYVLOQ=
=zZXq
-----END PGP SIGNATURE-----


More information about the Tutor mailing list