def ossystem(cmd):
  """Like os.system, but returns output of command as string."""
  p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,
                       stderr=subprocess.STDOUT)
  (stdout, stderr) = p.communicate()
  return stdout.decode('ascii')
def ossystem ( cmd ) : p = subprocess . Popen ( cmd , shell = True , stdout = subprocess . PIPE , stderr = subprocess . STDOUT ) ( stdout , stderr ) = p . communicate ( ) return stdout . decode ( 'ascii' )
Like os.system, but returns output of command as string.