コード例 #1
0
ファイル: utils.py プロジェクト: saurabh3091/predictionio
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())
コード例 #2
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())
コード例 #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())
コード例 #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)
コード例 #5
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())
コード例 #6
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)