subprocess.check_output() doesn’t seem to exist (Python 2.6.5)

It was introduced in 2.7 See the docs.

Use subprocess.Popen if you want the output:

>>> import subprocess
>>> output = subprocess.Popen(['ls', '-l'], stdout=subprocess.PIPE).communicate()[0]

Leave a Comment