while trying to use subprocess library in a for loop in python to execute multiple commands simultaneously the loop doesn't go for the next iteration until the system does an output. so I decided to remove the part of outut, err = p.communicate(). Once done, they run simultaneously but can't the see the output. What I want is running multiple commands in python simultaneously and observe the output of each of these commands. I'm using this to run mutliple iperf clients and multiple iperf servers with different ip addresses from the same machine.
Asked
Active
Viewed 94 times
1
-
Just use asyncio https://docs.python.org/3/library/asyncio.html And you'll be able to do what you want – SakuraFreak May 04 '20 at 10:05