how to run any command prompt command in python code example Example: how to run cmd command python import subprocess subprocess.run(["ls", "-l"])