文章目录
外部链接
[1]subprocess
[2]python subprocess模块使用总结
subprocess
The subprocess module allows you to spawn new processes, connect to their input/output/error pipes, and obtain their return codes.
0,subprocess.run()
使用参数运行命令并返回完整的进程实例
subprocess.run(args, *, stdin=None, input=None, stdout=None, stderr=None, capture_output=False, shell=False, cwd=None, timeout=None, check=False, encoding=None, errors=None, text=None, env=None, universal_newlines=None)
If capture_output is true, stdout and stderr will be captured. When used, the internal Popen object is automatically created with stdout=PIPE and stderr=PIPE. The stdout and stderr arguments may not be supplied at the same time as capture_output. If you wish to capture and combine both streams into one, use stdout=PIPE and stderr=STDOUT instead of capture_output.
result = subprocess