I have a script that uses subprocess.run in this manner:
subprocess.run
from subprocess import run p1 = run(command, shell=True, capture_output=True, text=True)