os.subprocess – Subprocess management

Example

from os.subprocess import run

func main():
    proc = run("ls")
    print(proc)

API

class CompletedProcess:
    exit_code: i64
    stdout: bytes
    stderr: bytes
func run(command: string,
         check: bool = True,
         capture_output: bool = True) -> CompletedProcess:
    Run given command in a subprocess and return it's exit code and
    output once completed.

    Raises an error if ``check`` is ``True`` and the subprocess exit code is
    not zero.

    Captures stdout and stderr if ``capture_output`` is ``True``.