📅  最后修改于: 2022-03-11 14:45:03.284000             🧑  作者: Mango
import subprocess
try:
subprocess.check_output("dir /f",shell=True,stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
raise RuntimeError("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output))