2 added 24 characters in body
source | link

In Python 3.5:

import subprocess

output = subprocess.run("ls -l", shell=True, stdout=subprocess.PIPE, 
                        universal_newlines=True)
print(output.stdout)

In Python 3.5:

import subprocess

output = subprocess.run("ls -l", shell=True)
print(output.stdout)

In Python 3.5:

import subprocess

output = subprocess.run("ls -l", shell=True, stdout=subprocess.PIPE, 
                        universal_newlines=True)
print(output.stdout)
1
source | link

In Python 3.5:

import subprocess

output = subprocess.run("ls -l", shell=True)
print(output.stdout)