how to let a python program do commands in cmd code example Example: how to run cmd command python import subprocess subprocess.run(["ls", "-l"])