Skip to main content

popen_wrapper

Friendly wrapper around Popen.

Return stdout output, stderr output, and OS status code.

def popen_wrapper(
args: list,
stdout_encoding: string = utf-8
) - > tuple

Friendly wrapper around Popen. Return stdout output, stderr output, and OS status code.

Parameters

NameTypeDescription
argslistA list of program arguments to execute, where the first item is the executable path or command
stdout_encodingstring = utf-8The character encoding used to decode the standard output stream

Returns

TypeDescription
tupleA tuple containing the decoded stdout string, the decoded stderr string (using locale encoding), and the integer process return code