Calling multiple programs with subprocess

Bryan bryanjugglercryptographer at yahoo.com
Fri Apr 23 11:38:20 CEST 2010


amit asked:
> How does one go about calling multiple programs using subprocess?
>
> This is the program flow:
>
> C:\> wrenv.exe
> C:\> make clean
> ..
>
> The 'wrenv.exe' is necessary since it sets up the proper environment
> for building. How do I use subprocess to execute 'wrenv.exe' and then
> the 'make clean' command.
>
> Any help is appreciated.

In this case I don't see that you need to call multiple programs
simultaneously. You call 'wrenv.exe', then when and if it completes
successfully you call 'make clean'. Calling multiple programs
sequentially should be straightforward. What, specifically, is going
wrong?

Python's subprocess module rocks on Unix, and provides some useful
corresponding features that are easily available on MS Windows. If
your job is to rock on Windows, don't commit to modules devoted to
rockin' on Unix. Python has multiple ways to run "wrenv.exe", then
"make clean". In particular, check out os.system.


--
--Bryan



More information about the Python-list mailing list