numpy.distutils.exec_command.exec_command#

distutils.exec_command.exec_command(command, execute_in='', use_shell=None, use_tee=None, _with_python=1, **env)[source]#

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

自 1.17 版本弃用:请改用 subprocess.Popen

参数:
commandstr

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

execute_instr

在运行命令前,先执行 cd execute_in;命令运行后,再执行 cd -

use_shell{bool, None},可选

如果为 True,则执行 sh -c command。默认为 None (即 True)

use_tee{bool, None},可选

如果为 True,则使用 tee。默认为 None (即 True)

返回:
resstr

标准输出和标准错误消息。

注意

在 NT、DOS 系统上,外部命令的返回状态是正确的。通配符在非 posix 系统或 use_shell=0 时无效。