os run shell command python

import subprocess
subprocess.run(["ls", "-l"])

Here is what the above code is Doing:
1. It’s creating a subprocess.
2. It’s running the ls command.
3. It’s passing the -l argument to the ls command.
4. It’s waiting for the ls command to complete.
5. It’s returning the exit code of the ls command.