Enter parameters into Fortran executable from python cgi script

John Hunter jdhunter at ace.bsd.uchicago.edu
Fri Jul 11 17:51:50 CEST 2003


>>>>> "lamar" == lamar air <lamar_air at hotmail.com> writes:


    lamar> How do i do this correctly?  testrun3 can be accesed from
    lamar> any dir because it's directory is set in the environment
    lamar> variables.

If you want to interact with a program, you need to use popen2 or
popen3, which give you access to the stdin, stdout and stderr
(popen3).

See this thread for a similar discussion and working example:

http://www.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=off&threadm=mailman.1054062582.11873.python-list%40python.org&rnum=1&prev=/groups%3Fas_q%3Dpopen2%26safe%3Doff%26ie%3DUTF-8%26oe%3DUTF-8%26as_uauthors%3Djdhunter%2540ace.bsd.uchicago.edu%26lr%3D%26num%3D20%26hl%3Den


Note, you could also expose the fortran functions to python directly
with f2py.  It is really very easy and automated

http://cens.ioc.ee/projects/f2py2e/


John Hunter





More information about the Python-list mailing list