Run an external program from Python?

Syver Enstad syver at NOSPAMcyberwatcher.com
Wed Nov 8 06:56:49 EST 2000


"Joakim Hove" <hove at phys.ntnu.no> wrote in message
news:k0nsnp2zpl6.fsf at dhcp-49138.phys.ntnu.no...
> Hello,
>
> I am writing a small python program to automate the compilation of
> another (fortran) program. In this process I need my python program to
> call the "make" program.
>
> In Perl I would do simply:
>
>   system("make PROG=Run");
>
> And the Perl program would wait around till the system call was
> finished.
Yess it is and it's called TADA! system ;-)

So do:
import os
os.system('make PROG=Run')

and the system call blocks too while the other program is running.





More information about the Python-list mailing list