Is python a good choice for this task?

Ron Lau ral at spongebob.corporate.com
Mon Nov 11 15:29:21 EST 2002


Hi,

This IS NOT a request for someone to write a program for me. (But I won't
turn it down :)  ).  The only programming I ever did was FORTRAN >:P , and short shell
scripts. I'm just looking for advice.


I have a CFD program that takes a text file as input (Q1.1). I run it on the
command line as:

phoe Q1.1

which outputs the binary file PH.1


I also have a program that gives me a number as the last line of its
output to the terminal with the command

pointquerey  PH.1 TempK 1 1 1 | tail -1


What I do now is compare the output of the line above to the value I want
it to be, then change a parameter in the Q1.1 file, say T1=500.0

I would like to write something that would Goal Seek this for me.
(something simple like a newtonian method)

So I would need a program to..
--------------------------

run the command "phoe Q1.1"

then run the command "pointquery PH.1 TempK 1 1 1 | tail -1"

read the output of the above and compare to the desired value.

calculate a better value of T1.

replace T1=oldvalue in the file Q1.1 with the calculated value from
above.

loop back to the beginning...

-------------------------


My question is, What language is best suited for this? Perl, Python, or
shell scripts?


TIA!

ral



More information about the Python-list mailing list