import subprocess proc = subprocess.Popen(['my_script.py', 'arg1', 'arg2'], stdout=subprocess.PIPE) out, err = proc.communicate() if err: print('Error:', err) ...
I will start with saying that documentation for subprocess.Popen is not clear. I was using subprocess.run(..., input=..., ...) and needed to monitor other things ...