subprocess-util/exec_capture.py

11 lines
280 B
Python

import subprocess
def execute_capture(command: list[str]) -> [int, str, str]:
completed: subprocess.CompletedProcess = subprocess.run(
command,
capture_output=True,
text=True,
)
return completed.returncode, completed.stdout, completed.stderr