numpy.distutils.exec_command.exec_command

distutils.exec_command.exec_command(command, execute_in='', use_shell=None, use_tee=None, _with_python=1, **env)[源代码]

已执行命令的返回(状态、输出)。

1.17 版后已移除: 使用子流程.Popen相反

参数
commandSTR

可执行文件和参数的串联字符串。

execute_inSTR

运行命令前 cd execute_in 之后呢 cd - .

use_shell{bool,None},可选

如果为True,则执行 sh -c command . 默认无(True)

use_tee{bool,None},可选

如果是真的,请使用T恤。默认无(True)

返回
resSTR

stdout和stderr消息。

笔记

在NT、DOS系统上,对于外部命令,返回的状态是正确的。通配符不适用于非posix系统或使用u shell=0时。