subprocess.getoutput()

subprocess.getoutput(cmd) Return output (stdout and 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: >>> subprocess.getoutput('ls /bin/ls') '/bin/ls' Availability: POSIX & Windows Changed in version 3.3.4: Windows support added

subprocess.CompletedProcess.stdout

stdout Captured stdout from the child process. A bytes sequence, or a string if run() was called with universal_newlines=True. None if stdout was not captured. If you ran the process with stderr=subprocess.STDOUT, stdout and stderr will be combined in this attribute, and stderr will be None.

subprocess.CompletedProcess.stderr

stderr Captured stderr from the child process. A bytes sequence, or a string if run() was called with universal_newlines=True. None if stderr was not captured.

subprocess.CompletedProcess.returncode

returncode Exit status of the child process. Typically, an exit status of 0 indicates that it ran successfully. A negative value -N indicates that the child was terminated by signal N (POSIX only).

subprocess.CompletedProcess.check_returncode()

check_returncode() If returncode is non-zero, raise a CalledProcessError.

subprocess.CompletedProcess.args

args The arguments used to launch the process. This may be a list or a string.

subprocess.CompletedProcess

class subprocess.CompletedProcess The return value from run(), representing a process that has finished. args The arguments used to launch the process. This may be a list or a string. returncode Exit status of the child process. Typically, an exit status of 0 indicates that it ran successfully. A negative value -N indicates that the child was terminated by signal N (POSIX only). stdout Captured stdout from the child process. A bytes sequence, or a string if run() was called wi

subprocess.check_output()

subprocess.check_output(args, *, stdin=None, stderr=None, shell=False, universal_newlines=False, timeout=None) Run command with arguments and return its output. If the return code was non-zero it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute and any output in the output attribute. This is equivalent to: run(..., check=True, stdout=PIPE).stdout The arguments shown above are merely the most common ones. The full function signa

subprocess.check_call()

subprocess.check_call(args, *, stdin=None, stdout=None, stderr=None, shell=False, timeout=None) Run command with arguments. Wait for command to complete. If the return code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. This is equivalent to: run(..., check=True) (except that the input parameter is not supported) The arguments shown above are merely the most common ones. The full function signatu

subprocess.CalledProcessError.stdout

stdout Alias for output, for symmetry with stderr.