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

Function getoutput

IPython/utils/_process_cli.py:47–63  ·  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

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

Callers 5

test_getoutputMethod · 0.90
test_getoutput_quotedMethod · 0.90
getoutputMethod · 0.90

Calls

no outgoing calls

Tested by 4

test_getoutputMethod · 0.72
test_getoutput_quotedMethod · 0.72