I have 12 programs which i intend to run simultaneously. Is there any way i run all of them via one single program which when built runs the 12 programs?
I am using sublime and the programs are python.
I have 12 programs which i intend to run simultaneously. Is there any way i run all of them via one single program which when built runs the 12 programs?
I am using sublime and the programs are python.
If you just want to execute the programs one by one in a batch, you can do it in a bash script. Assuming they are executables in the same folder, you can have an
.sh
file with the following contents:If the scripts themselves have the
#!/usr/bin/env python
at the top to identify the interpreter, you can dochmod +x
on them, and turn yourrunner.sh
file into:On the other hand, if you want to do this from a python script, you can use:
Note 1: don't forget to include the
#!/usr/bin/env python
in every script on the first line.Note 2: it is important to use
subprocess.Popen()
insteadsubprocess.call()
because the latter is a blocking function that will wait for the application to finish before proceeding. Withsubproces.Popen()
you get the concurrent execution.