Python: Call shell command
Call shell command, wait, get output
# call shell command and get its output import subprocess # on windows # output = subprocess.run(["dir"], text=True, shell=True, check=True) # on linux output = subprocess.run(["ls -al"], text=True, shell=True, check=True) print(output)