import subprocess p = subprocess.Popen(['ls','-al'], stdout=subprocess.PIPE) res = p.stdout.read() print (res)