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 获取输出,等待运行完成
最新推荐文章于 2025-06-04 18:38:58 发布