I am experiencing some problems when using subprocess.Popen()
to spawn several instances of the same application from my python script using threads to have the
Sadly when running your subprocess using shell=True
, wait() will only wait for the sh
subprocess to finish and not for the command cmd
.
I will suggest if it possible to don't use the shell=True
, if not possible you can create a process group like in this answer and use os.waitpid to wait for the process group not just the shell process.
Hope this was helpful :)