def getstatusoutput(cmd):
    import os
    pipe = os.popen('{ ' + cmd + '; } 2>&1', 'r')
    text = pipe.read()
    sts = pipe.close()
    if sts is None: sts = 0
    if text[-1:] == '\n': text = text[:-1]
    return sts, text


# Make command argument from directory and pathname (prefix space, add quotes).
#
Robust test CGI script, usable as main program.
dataset/ETHPy150Open azoft-dev-team/imagrium/env/Lib/commands.py/getstatusoutput--crossover with--dataset/ETHPy150Open azoft-dev-team/imagrium/env/Lib/cgi.py/test