[Tutor] how to invoke a fortran executable on MS-DOS system?
Daniel Yoo
dyoo@hkn.EECS.Berkeley.EDU
Mon, 28 Aug 2000 16:45:57 -0700 (PDT)
On Mon, 28 Aug 2000, Lin Zhang wrote:
> I thought I posted this last friday, but did not get a
> copy to myself.
>
> Does anyone know how to invoke a fortran executable on
> MS-DOS system from a python script? I know this can be
> done easily on unix with shell script.
Whoops, I didn't see your previous email. Ok, to access any system
command or script, you should be able to use the os.system() command:
###
>>> import os
>>> os.system("ls")
#pico07694# cs188 exam_template.html mbox resume
GNUstep cs198 exams messages rgb00001.pat
# and lots of other files
###
Any other commands should work as well --- you might need to indicate the
full path of your Fortran program.
There's an alternative command, os.popen(), but I can't say how well it'll
work on Windows; I've heard that Windows's implementation is broken.
However, Python 2.0, which will be coming out soon, should have a fixed
popen().
The documentation for os.system can be found here:
http://python.org/doc/current/lib/os-process.html#l2h-915