import subprocess
def excuteCommand(com):
ex = subprocess.Popen(com, stdout=subprocess.PIPE, shell=True)
out, err = ex.communicate()
status = ex.wait()
print("cmd in:", com)
print("cmd out: ", out.decode())
return out.decode()
python Popen 获取输出,等待运行完成
最新推荐文章于 2024-04-16 20:51:49 发布