Exemple #1
0
def srun_out(command):
  """ Runs a shell command given as a `str`
  Returns: string with command's output
  Raises: `subprocess.CalledProcessError` when exit code != 0
  """
  return check_output(command, shell=True, universal_newlines=True,
      stderr=globals.std_err())
def srun_out(command):
  """ Runs a shell command given as a `str`
  Returns: string with command's output
  Raises: `subprocess.CalledProcessError` when exit code != 0
  """
  return check_output(command, shell=True, universal_newlines=True,
      stderr=globals.std_err())
Exemple #3
0
def srun_bg(command):
    """ Runs a shell command given as a `str` in the background
  Returns: (obj: `subprocess.Popen`) for executed process
  """
    return Popen(command,
                 shell=True,
                 stdout=globals.std_out(),
                 stderr=globals.std_err())
Exemple #4
0
def srun(command):
    """ Runs a shell command given as a `str`
  Raises: `subprocess.CalledProcessError` when exit code != 0
  """
    return run(command,
               shell=True,
               stdout=globals.std_out(),
               stderr=globals.std_err(),
               check=True)
def srun_bg(command):
  """ Runs a shell command given as a `str` in the background
  Returns: (obj: `subprocess.Popen`) for executed process
  """
  return Popen(command, shell=True, stdout=globals.std_out(),
      stderr=globals.std_err())
def srun(command):
  """ Runs a shell command given as a `str`
  Raises: `subprocess.CalledProcessError` when exit code != 0
  """
  return run(command, shell=True, stdout=globals.std_out(),
      stderr=globals.std_err(), check=True)