[F2PY] Fortran call fails in IDLE / PyScripter

Hi all, I compile the followinq code using "f2py -c --fcompiler=gnu95 --compiler=mingw32" -m hello subroutine AfficheMessage(szText) character szText*100 write (*,*) szText return end
Using python console :
import hello hello.affichemessage("
Hello") works fine !
I do the same in the program window of IDLE and : - no message is displayed. - the shell restart (or IDLE crah if launched with -n)
Same problem with PyScripter IDE. (crash).
Any suggestion ? Regards, Christophe

On Tue, Dec 2, 2008 at 9:26 AM, Christophe Chappet Christophe.Chappet@onera.fr wrote:
Hi all, I compile the followinq code using "f2py -c --fcompiler=gnu95 --compiler=mingw32" -m hello subroutine AfficheMessage(szText) character szText*100 write (*,*) szText return end
Using python console :
import hello hello.affichemessage("
Hello") works fine !
I do the same in the program window of IDLE and :
- no message is displayed.
- the shell restart (or IDLE crah if launched with -n)
Same problem with PyScripter IDE. (crash).
Any suggestion ? Regards, Christophe
Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Is this a write to standard output "write (*,*) szText" ?
Robert Kern mentioned several times that mingw is broken for writing to stdout but I only know about it for stdout in c. I always get a crash when a test compiles a write to stdout in c with mingw on my WindowsXP. But then my impression is that it shouldn't work on the command line either.
Since I don't know much about f2py, I'm not sure whether fortran has the same problem as c with mingw.
Josef

On Tue, Dec 2, 2008 at 08:26, Christophe Chappet Christophe.Chappet@onera.fr wrote:
Hi all, I compile the followinq code using "f2py -c --fcompiler=gnu95 --compiler=mingw32" -m hello subroutine AfficheMessage(szText) character szText*100 write (*,*) szText return end
Using python console :
import hello hello.affichemessage("
Hello") works fine !
I do the same in the program window of IDLE and :
- no message is displayed.
- the shell restart (or IDLE crah if launched with -n)
Same problem with PyScripter IDE. (crash).
What version of gfortran are you using (i.e. exactly which binary did you download)?
I'm not sure about the crash, but I can say that you will never get the output from a write statement inside the Fortran code to go to the IDLE prompt or PyScripter's window. They are not real terminals and do not capture text going to the process's real STDOUT file pointer. They simply change the sys.stdout object to capture text printed from Python.
participants (3)
-
Christophe Chappet
-
josef.pktd@gmail.com
-
Robert Kern