ngamsPlugInApi.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:ngas 作者: ICRAR 项目源码 文件源码
def execCmd(cmd,
            timeOut = -1):
    """
    Execute the command given on the UNIX command line and returns a
    list with the cmd exit code and the output written on stdout and stderr.

    cmd:         Command to execute on the shell (string).

    timeOut:     Timeout waiting for the command. A timeout of "-1" means
                 that no timeout is applied (float).

    Returns:     Tuple with the exit code and output on stdout and stderr:

                   [<exit code>, <stdout>]
    """
    logger.debug("Executing command: %s", cmd)
    if (timeOut == -1):
        return commands.getstatusoutput(cmd)
    else:
        exitCode, stdout, stderr = ngamsCoreExecCmd(cmd, timeOut)
        return [exitCode, stdout]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号