run python bash code example
Example 1: How to run bash script in python
import subprocess
print "start"
subprocess.call("sleep.sh")
print "end"
Example 2: how to execute bash commands in python script
import subprocess
subprocess.call(["sudo", "apt", "update"])