1.

import os
os.system('ls')

2.
from subprocess import call
call('ls')

Source: http://unix.stackexchange.com/questions/238180/execute-shell-commands-in-python

Advertisements