Discussion:
[f2py] The same problem in importing fortran codes in Python!!!
Happyman
2012-12-02 22:35:22 UTC
Permalink
Dear Python users

I have Python 2.7.3 version and name.f (fortran code), but I do not have fortran program.

I DID THE FOLLOWING STEPS, BUT IT WAS NOT WORKING:

1) I downloaded f2py and installed it.. in Python I typed : f2py and result ---> 'C:\Python27\lib\site-packages\numpy\f2py\__init__.py' It means that it exists.  And then I typed from numpy import f2py.
2) I created fortran code (hello.f) in Notepad and saved it as *.f code and I put this file into f2py folder (Am I wrong?)
3) Then I put 'f2py -c -m hello hello.f.. The error occurred: SyntaxError: invalid syntax  '

Basically, what do I have to do first/??? 

Please, give your response as full/complete as possible I have had really hard situation in Python...

Thanks in advance,


--
Zhenfei Yuan
2012-12-03 05:28:16 UTC
Permalink
Post by Happyman
Dear Python users
I have Python 2.7.3 version and name.f (fortran code), but I do not have fortran program.
1) I downloaded f2py and installed it.. in Python I typed : f2py and
result ---> 'C:\Python27\lib\site-packages\numpy\f2py\__init__.py' It
means that it exists. And then I typed from numpy import f2py.
2) I created fortran code (hello.f) in Notepad and saved it as *.f
code and I put this file into f2py folder (Am I wrong?)
SyntaxError: invalid syntax '
Basically, what do I have to do first/???
Please, give your response as full/complete as possible I have had
really hard situation in Python...
Thanks in advance,
--
_______________________________________________
f2py-users mailing list
http://cens.ioc.ee/mailman/listinfo/f2py-users
You need a fortran compiler on windows. You could download and install
Mingw, which contains gfortran compiler.

Jeffrey Yuan

Loading...