Re: [f2py] The same problem in importing fortran codes in Python!!!

Zhenfei Yuan <[email protected]> Mon, 03 Dec 2012 13:28:16 +0800
Newsgroups gmane.comp.python.f2py.user
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--===============6974626919641076065==
Content-Type: multipart/alternative;
 boundary="------------080600050600050600010206"

This is a multi-part message in MIME format.
--------------080600050600050600010206
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

On 12/03/2012 06:35 AM, Happyman wrote:
> 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,
>
>
> -- 
>
>
>
> _______________________________________________
> f2py-users mailing list
> f2py-users-Y4l6ocDipWCuvFJfX82//[email protected]
> 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

--------------080600050600050600010206
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 12/03/2012 06:35 AM, Happyman wrote:<br>
    </div>
    <blockquote cite="mid:1354487722.133802051-OcWLN3UoBrcedp2WBT/[email protected]" type="cite">
      Dear Python users<br>
      <br>
      I have Python 2.7.3 version and name.f (fortran code), but I do
      not have fortran program.<br>
      <br>
      I DID THE FOLLOWING STEPS, BUT IT WAS NOT WORKING:<br>
      <br>
      1) I downloaded f2py and installed it.. in Python I typed : f2py
      and result ---&gt;
      'C:\Python27\lib\site-packages\numpy\f2py\__init__.py' It means
      that it exists. &nbsp;And then I typed from numpy import f2py.<br>
      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?)<br>
      3) Then I put 'f2py -c -m hello hello.f.. The error&nbsp;occurred:
      SyntaxError: invalid syntax&nbsp; '<br>
      <br>
      Basically, what do I have to do first/???&nbsp;<br>
      <br>
      Please, give your response as full/complete as possible I have had
      really hard situation in Python...<br>
      <br>
      Thanks in advance,<br>
      <br>
      <br>
      -- <br>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
f2py-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:f2py-users-Y4l6ocDipWCuvFJfX82//[email protected]">f2py-users-Y4l6ocDipWCuvFJfX82//[email protected]</a>
<a class="moz-txt-link-freetext" href="http://cens.ioc.ee/mailman/listinfo/f2py-users">http://cens.ioc.ee/mailman/listinfo/f2py-users</a>
</pre>
    </blockquote>
    <br>
    <br>
    You need a fortran compiler on windows. You could download and
    install Mingw, which contains gfortran compiler.<br>
    <br>
    Jeffrey Yuan<br>
  </body>
</html>

--------------080600050600050600010206--



--===============6974626919641076065==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
f2py-users mailing list
f2py-users-Y4l6ocDipWCuvFJfX82//[email protected]
http://cens.ioc.ee/mailman/listinfo/f2py-users

--===============6974626919641076065==--