MCPcopy Index your code
hub / github.com/ipython/ipython / getoutput

Function getoutput

IPython/utils/_process_cli.py:39–55  ·  view source on GitHub ↗

getoutput(cmd) should work in a cli environment on Mac OSX, Linux, and Windows

(cmd)

Source from the content-addressed store, hash-verified

37
38
39def getoutput(cmd):
40 """
41 getoutput(cmd) should work in a cli environment on Mac OSX, Linux,
42 and Windows
43 """
44 psi = System.Diagnostics.ProcessStartInfo(cmd)
45 psi.RedirectStandardOutput = True
46 psi.RedirectStandardError = True
47 psi.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal
48 psi.UseShellExecute = False
49 # Start up process:
50 reg = System.Diagnostics.Process.Start(psi)
51 myOutput = reg.StandardOutput
52 output = myOutput.ReadToEnd()
53 myError = reg.StandardError
54 error = myError.ReadToEnd()
55 return output
56
57
58def check_pid(pid):

Callers 5

getoutputMethod · 0.90
test_getoutputMethod · 0.90
test_getoutput_quotedMethod · 0.90

Calls

no outgoing calls

Tested by 4

test_getoutputMethod · 0.72
test_getoutput_quotedMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…