Python 3
    Python 3 - Overview
    Python 3 - Install
    Python 3 - REPL
    Python 3 - RegEx
    Python 3 - List
    Python 3 - XML/YAML
    Python 3 - DateTime
    Python 3 - Subprocess
    Python 3 - pickle
    Python 3 - env
    Python 3 - lib
    Python 3 - Trouble Shooting
    Python 2 to 3

Python 3 - subprocess

Updated: 2022-04-04

To execute another program (e.g. a linux command), use subprocess

>>> import subprocess
>>> result = subprocess.run(["ls", "-l"])
(output of "ls -l")
>>> result
CompletedProcess(args=['ls', '-l'], returncode=0)

result is a CompletedProcess, however it does not capture the result; to do that add stdout

>>> result = subprocess.run(["ls", "-l"], stdout=subprocess.PIPE)
>>> print(result.stdout.decode())