parameters: (cmd)
return_statement: return sts, text
docstring: Return (status, output) of executing cmd in a shell.
docstring_summary: Return (status, output) of executing cmd in a shell.
docstring_tokens: Return ( status output ) of executing cmd in a shell .
function: def getstatusoutput(cmd):
      """Return (status, output) of executing cmd in a shell."""
      if on_windows():
          pipe = os.popen(cmd + ' 2>&1', 'r')
      else:
          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
function_tokens: def getstatusoutput ( cmd ) : if on_windows ( ) : pipe = os . popen ( cmd + ' 2>&1' , 'r' ) else : 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