On Unix, the return value is the exit
status of the process encoded in the
format specified for wait(). Note that
POSIX does not specify the meaning of
the return value of the C system()
function, so the return value of the
Python function is system-dependent.
幸运的是,用于分析返回状态的C宏在os模块中可用(启动here)
我在amd64/Linux上运行了这些:>>> import os
>>> os.WIFEXITED(24) #Return True if the process exited using the exit(2) system call
False
>>> os.WIFSIGNALED(24) #Return True if the process exited due to a signal
True
>>> os.WTERMSIG(24) #Return the signal which caused the process to exit
24
根据http://linux.die.net/man/7/signal,我认为信号24可能是SIGTSTP(有人通过按CTRL+Z停止了进程)。你在哪个平台/架构上运行?
(接下来,我建议您使用subprocess模块,这样您就可以捕获stdout/stderror)
更新
有人发布了它,然后它就消失了,但是信号24很可能是SIGXCPU(超过了CPU时间限制)