import subprocess print(subprocess.run(["dir"], shell=True, capture_output=True).stdout)