I have been looking through Google and SO for something that could help me solve this but I have run into a block. I am a bit new to Python but I am looking for a way to run multiple apps that will continuously run in the background.
For example, I need 4 apps to start up with a param -appnum set to a different value. I would like to use python to count up and then start up a new app that will continue to run.
I assumed I would use subprocess but I feel a bit overwhelmed by the documentation.
I also plan to have the app print out sequences of numbers and would like to redirect this to a file. I noticed some of the SO questions talked about this, but I am a little confused on what to do.
A simple way to start might be to use
os.popen(), like this:From here, you can read from each
subprog[i]just like a file, capturing the output of theappprogram.Note that although the documentation says this function has been deprecated, it still works perfectly fine for many purposes. You can explore the
subprocessmodule when you’re more familiar with the limitations ofos.popen().