def getoutput(self, cmd, split=True, depth=0):
    "Get output (possibly including stderr) from a subprocess.\n\n        Parameters\n        ----------\n        cmd : str\n            Command to execute (can not end in '&', as background processes are\n            not supported.\n        split : bool, optional\n            If True, split the output into an IPython SList.  Otherwise, an\n            IPython LSString is returned.  These are objects similar to normal\n            lists and strings, with a few convenience attributes for easier\n            manipulation of line-based output.  You can use '?' on them for\n            details.\n        depth : int, optional\n            How many frames above the caller are the local variables which should\n            be expanded in the command string? The default (0) assumes that the\n            expansion variables are in the stack frame calling this function.\n        "
    if cmd.rstrip().endswith('&'):
        raise OSError('Background processes not supported.')
    out = getoutput(self.var_expand(cmd, depth=(depth + 1)))
    if split:
        out = SList(out.splitlines())
    else:
        out = LSString(out)
    return out
Get output (possibly including stderr) from a subprocess.

Parameters
----------
cmd : str
    Command to execute (can not end in '&', as background processes are
    not supported.
split : bool, optional
    If True, split the output into an IPython SList.  Otherwise, an
    IPython LSString is returned.  These are objects similar to normal
    lists and strings, with a few convenience attributes for easier
    manipulation of line-based output.  You can use '?' on them for
    details.
depth : int, optional
    How many frames above the caller are the local variables which should
    be expanded in the command string? The default (0) assumes that the
    expansion variables are in the stack frame calling this function.
def getoutput(self, cmd, split=True, depth=0):
    "Get output (possibly including stderr) from a subprocess.\n\n        Parameters\n        ----------\n        cmd : str\n            Command to execute (can not end in '&', as background processes are\n            not supported.\n        split : bool, optional\n            If True, split the output into an IPython SList.  Otherwise, an\n            IPython LSString is returned.  These are objects similar to normal\n            lists and strings, with a few convenience attributes for easier\n            manipulation of line-based output.  You can use '?' on them for\n            details.\n        depth : int, optional\n            How many frames above the caller are the local variables which should\n            be expanded in the command string? The default (0) assumes that the\n            expansion variables are in the stack frame calling this function.\n        "
    if cmd.rstrip().endswith('&'):
        raise OSError('Background processes not supported.')
    out = getoutput(self.var_expand(cmd, depth=(depth + 1)))
    if split:
        out = SList(out.splitlines())
    else:
        out = LSString(out)
    return out