Skip to content

Command

Command(program, arguments, stdin=None, stdin_file=None, environment=None)

Run external command with arguments.

ATTRIBUTE DESCRIPTION
exit_code

exit code of the command after running it

stdout

standard output of the command after running it

stderr

standard error of the command after running it

PARAMETER DESCRIPTION
program

program to run

TYPE: str

arguments

list of arguments

TYPE: list[str]

stdin

string or list of strings to pass as standard input

TYPE: str | list[str] | None DEFAULT: None

stdin_file

file to use as standard input

TYPE: str | None DEFAULT: None

environment

dictionary with environment variables

TYPE: dict[str, str] | None DEFAULT: None

run()

Run the command.

RETURNS DESCRIPTION
bool

True if the command succeeded (exit code 0), False otherwise.