What are some usage of python subprocess for workflow optimization

Question: What are some usage examples of python subprocess (lets you interact with the operating system) for workflow optimization?

Rationale:
Before the python subprocess, I was quite comfortable using the os module in my research work. In fact, the os came in handy acting as a glue to connect modules, even with different programing languages as it is often the case with quantum chemistry programs. The subprocess module can be used in a similar way as the os module. I haven’t explore the subprocess module the way I had done with the os module. It appears one can launch many subprocess and even set communication between subprocesses.

I have one simple example: sandbox_python/writeout.py at main · prehensilecode/sandbox_python · GitHub

Other examples including code I currently use for sysadmin work.

I used to use “os” but switched to using “subprocess” quite a few years ago, now. It’s pretty straightforward. Just try it out.