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]#

傳回已執行命令的 (狀態, 輸出)。

Deprecated since version 1.17: 自 1.17 版本起已棄用:請改用 subprocess.Popen

參數::
commandstr

可執行檔與參數的串聯字串。

execute_instr

在執行命令前執行 cd execute_in,之後執行 cd -

use_shell{bool, None}, optional

若為 True,則執行 sh -c command。預設值為 None (True)

use_tee{bool, None}, optional

若為 True,則使用 tee。預設值為 None (True)

傳回值::
resstr

stdout 與 stderr 訊息。

註解

在 NT、DOS 系統上,傳回的狀態對於外部命令是正確的。萬用字元在非 posix 系統或當 use_shell=0 時將無法運作。