MCPcopy Create free account
hub / github.com/ipython/ipython / getoutputerror

Function getoutputerror

IPython/utils/_process_common.py:136–151  ·  view source on GitHub ↗

Return (standard output, standard error) of executing cmd in a shell. Accepts the same arguments as os.system(). Parameters ---------- cmd : str or list A command to be executed in the system shell. Returns ------- stdout : str stderr : str

(cmd)

Source from the content-addressed store, hash-verified

134
135
136def getoutputerror(cmd):
137 """Return (standard output, standard error) of executing cmd in a shell.
138
139 Accepts the same arguments as os.system().
140
141 Parameters
142 ----------
143 cmd : str or list
144 A command to be executed in the system shell.
145
146 Returns
147 -------
148 stdout : str
149 stderr : str
150 """
151 return get_output_error_code(cmd)[:2]
152
153def get_output_error_code(cmd):
154 """Return (standard output, standard error, return code) of executing cmd

Callers 1

test_getoutput_errorMethod · 0.90

Calls 1

get_output_error_codeFunction · 0.85

Tested by 1

test_getoutput_errorMethod · 0.72