subprocess
run
- confirm.utils.subprocess.run(*command, strip=True)
Run a system command and return the return code & output.
By default it will automatically strip leading & trailing whitespaces from the output:
>>> run('echo "SPAM"') Result(returncode=0, output='SPAM')
However, you can also disable the auto strip of whitespaces:
>>> run('echo "SPAM"', strip=False) Result(returncode=0, output='SPAM\n')
- Parameters:
*command (list) – The command arguments
strip (bool) – Remove leading & trailing whitespaces
- Returns:
The return code & output
- Return type:
Result