MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / getoutput

Function getoutput

tools/python-3.11.9-amd64/Lib/subprocess.py:681–691  ·  view source on GitHub ↗

Return output (stdout or stderr) of executing cmd in a shell. Like getstatusoutput(), except the exit status is ignored and the return value is a string containing the command's output. Example: >>> import subprocess >>> subprocess.getoutput('ls /bin/ls') '/bin/ls'

(cmd, *, encoding=None, errors=None)

Source from the content-addressed store, hash-verified

679 return exitcode, data
680
681def getoutput(cmd, *, encoding=None, errors=None):
682 """Return output (stdout or stderr) of executing cmd in a shell.
683
684 Like getstatusoutput(), except the exit status is ignored and the return
685 value is a string containing the command's output. Example:
686
687 >>> import subprocess
688 >>> subprocess.getoutput('ls /bin/ls')
689 '/bin/ls'
690 """
691 return getstatusoutput(cmd, encoding=encoding, errors=errors)[1]
692
693
694

Callers

nothing calls this directly

Calls 1

getstatusoutputFunction · 0.85

Tested by

no test coverage detected