提交 45382d22 编写于 作者: 盼小辉丶's avatar 盼小辉丶

上传新文件

上级 83633a49
import shlex
import subprocess
def run(command):
try:
result = subprocess.get_output(shlex.split(command), stderr=subprocess.STDOUT)
return 0, result
except subprocess.CalledProcessError as e:
return e.returncode, e.output
status, out = run('ls "/"')
print(status, out)
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册