To launch programs from my Python-scripts, I\'m using the following method:
def execute(command): process = subprocess.Popen(command, shell=True, stdout=s
In Python >= 3.5 using subprocess.run works for me:
subprocess.run
import subprocess cmd = 'echo foo; sleep 1; echo foo; sleep 2; echo foo' subprocess.run(cmd, shell=True)
(getting the output during execution also works without shell=True) https://docs.python.org/3/library/subprocess.html#subprocess.run
shell=True