473,322 Members | 1,314 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Help with Fortran output

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.

Murali
Jul 18 '05 #1
1 2358
"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.
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: lamar_air | last post by:
I have a fortran executable which when run from cmd it asks for a series of parameters which you enter then hit enter. From my python cgi script i want to be able to run the executable. Enter the...
5
by: Michael Hiegemann | last post by:
Hello, I am unaware whether this is the right group to ask. Please point me to another forum if required. I would like to replace a Fortran function by one which is written in C. The function...
5
by: google | last post by:
first, a little background... i have a C program which preprocesses some data, and then outputs the results into a text file. that text file, in turn, is used as input to a FORTRAN...
3
by: David Dvali | last post by:
Hello. I have one small program which I need to convert in C#. The original source codes are written in Fortran 77. Can anybody advice me what is the easy way to do this task? Or may be there...
8
by: Neil | last post by:
Hello Everyone.. I wrote a function called "totalsales" for a short business program I wrote, and I can't keep the decimal point aligned in the colums in the printf output statement. The data...
10
by: Tyler | last post by:
Hello All: After trying to find an open source alternative to Matlab (or IDL), I am currently getting acquainted with Python and, in particular SciPy, NumPy, and Matplotlib. While I await the...
52
by: Nomad.C | last post by:
Hi I've been thinking of learning Fortran as number crunching kinda language for my Physics degree......but then looking around the internet, people are saying that the libraries/ Algorithms once...
13
by: Mangabasi | last post by:
Howdy, I have been trying to call the following Fortran function from Python (using Windows XP, Compaq Fortran and Python 2.4). I tried F2Py, Pyfort and calldll with no success. I think I...
9
by: a-lbi | last post by:
I use gcc compiler (version 2.8.1). During linking I get the following error message: Undefined first referenced symbol in file log10l ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.