![]() The time.sleep(1) bit is ugly, what it does it that it will but I guess it will do the trick for 99% of the cases. Perf = subprocess.Popen(, stderr=subprocess.PIPE) That means you'd end up with this python program: import subprocess Without forks it won't work because after you SIGINTed the perf process you cannot read from stdin any more as the process is already gone, and when you read from stdin first you won't get any output until perf is correctly terminated. import subprocess def runcommand(command): process subprocess.Popen(command, shellTrue) process.wait() Wait for the process to complete List of commands to run in parallel commands 'command1', 'command2', 'command3', Add more commands as needed Create a list to store the subprocess objects processes.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |