I want to run the following bash command in Python 3:
ls -l
I know that I can do the following:
from subprocess import call
from subprocess import Popen, PIPE output = Popen(['ls', '-l'], stdout=PIPE).communicate()[0]
You can then do whatever you want with the output. See python docs for detailed documentation