[f2py] Fortran print* statements not showing up in Python session

Joe jomurd at yahoo.com
Sat Apr 1 08:19:33 EEST 2006


I've been playing with Enthought's latest Python
release (enthon-python2.3-0.9.3.exe) and I'm loving
f2py. Unfortunately, none of my Fortran print*
statements show up in my Python session. The tutorial
shows them printing out.

This is my sample program:
C File hello.f
      subroutine foo (a)
      integer a
cf2py intent(in,out) :: a
      print*, "Hello from Fortran!"
      print*, "a=",a
      end

I am using mingw on Windows XP (Service Pack 1, Intel
Pentium 4), and my command line looks like this:
   f2py -c hello.f --compiler=mingw32 -m hello
which runs successfully, and creates a hello.pyd

This is my Python session:
IDLE 1.0.5      
>>> import hello
>>> print hello.__doc__
This module 'hello' is auto-generated with f2py
(version:2.45.241_1926).
Functions:
  a = foo(a)
.
>>> hello.foo(4)
4
>>> 

The Fortran print* statement doesn't show.

f2py version = 2.45.241_1926

g77 version = GCC 3.2.3 (mingw special 20030504-1))
3.2.3 20030425 (release)

gcc version = 3.2.3 (mingw special 20030504-1)

I already feel like f2py is a Red Rider BB Gun on
Christmas morning, but I can't help thinking that
getting these print* statements to work will be a
powerful debugging technique. 

Any guidance will be gratefully appreciated.



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the f2py-users mailing list