# 获取 Windows 系统执行命令后的标准输出及错误数据
stdout, stderr = subprocess.Popen(
new_cmd, stdout=subprocess.PIPE,
stderr=subprocess.PIPE
).communicate()
print(stdout)
# 获取 Windows 系统执行命令后的标准输出及错误数据
stdout, stderr = subprocess.Popen(
new_cmd, stdout=subprocess.PIPE,
stderr=subprocess.PIPE
).communicate()
print(stdout)
本文标题:Python subprocess 模块
本文链接:https://www.haomeiwen.com/subject/lnsxuqtx.html
网友评论