How to check which command is running by subprocess.Popen in Python?

Viewed 15

I'm trying to run bash commands one by one using Python subprocess. The first I tried is to call commands with Popen in loop but it runs all of the commands in one time. I can just wait for the command ending or return value but I don't want to. I have a main process and I would like to open ONLY one process next to it when the commands run one by one. I can't do it so I gave a list of commands to Popen. It works but I would like to know which command is running at a time. For example there is 15 commands in a list and I run them with Popen and I would like to do something between the commands. (the commands take 2-4 mins to return with a value) Is there a way to solve this?

0 Answers
Related