How to run bash script in python code example
Example 1: execute command in python script
import os
os.system("ma Commande")
#Exemple:
os.system("cd Documents")
Example 2: How to run bash script in python
import subprocess
print "start"
subprocess.call("sleep.sh")
print "end"
Example 3: how to execute bash commands in python script
import subprocess
subprocess.call(["sudo", "apt", "update"])
Example 4: bash script python
subscription-manager register --username=admin --password=secret