python-执行shell命令

def runShell(cmd):
    try:
        (status, output) = commands.getstatusoutput(cmd)
    except Exception, e:
        return (1, "")
    # write shell and shell's result into shelllog

    return status, output
posted @ 2018-11-30 10:45  枫子_dan  阅读(173)  评论(0编辑  收藏  举报