python3 subprocess code example
Example 1: subprocess python
import subprocess
import sys
result = subprocess.run([sys.executable, "-c", "print('ocean')"])
Example 2: python format subprocess output
import subprocess
output = subprocess.check_output("cat /etc/os-release", shell=True)
output = output.decode("utf-8")
print("Version info: ",output)