"Kumbale, Murali T." <MK******@southernco.com> wrote in message news:<ma**************************************@pyt hon.org>...
I am new to Python and redirection etc. I created a simple COM object
in Visual FORTRAN called "disp.disp" that writes to the WINDOWS console.
I wrote a Python script which looks like the following
import win32com.client
o = win32com.client.Dispatch("disp.disp")
o.SimpeAdd(5)
SimpleAdd method takes the argument supplied (the number 5 in this case)
and adds 10 to it and then writes to FORTRAN standard output using
WRITE(6,...). This bombs as I don't know how to capture the FORTRAN
output written to WINDOWS console to Python console. Please help.
I am ignorant of COM, but Fortran (or other) standard output can be
captured by Python. If I compile the Fortran program
write (6,*) "hi from Fortran"
end
to an executable 'foo.exe' and have a Python script 'xread.py'
import sys
text = sys.stdin.readline()
print text
then typing at the Windows command prompt
'foo.exe | python xread.py'
gives the output
hi from Fortran
If this does not answer your question, your problem may be
Fortran-specific -- consider posting to comp.lang.fortran or (even
better) to the Intel Visual Fortran discusssion forum.