Use the subprocess module:
import subprocess
subprocess.call("shell commands go in here")
This will execute shell commands from within the location of your Python script. Example:
import subprocess
subprocess.call(["ping", "www.google.com"])
PING www.google.com (178.59.100.242) 56(84) bytes of data.
64 bytes from cache.google.com (178.59.100.242): icmp_req=1 ttl=54 time=19.1 ms