title: Python: subprocess.check_output()
body: <p>I am trying to retreive a list of CPU features, for a configure.py script I'm writing. In the shell, I do as follows:</p>
  
  <pre><code>$ cat /proc/cpuinfo|grep flags|head -1|cut -d\: -f2
   fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms
  </code></pre>
  
  <p>My naive attempt is to write:</p>
  
  <pre><code>features = subprocess.check_output("cat /proc/cpuinfo|grep flags|head -1|cut -d\: -f2").split()
  </code></pre>
  
  <p>But I get some errors:</p>
  
  <pre><code>File "./configure.py", line 14, in &lt;module&gt;
    features = subprocess.check_output("cat /proc/cpuinfo|grep flags|head -1|cut -d\: -f2").split()
  File "/usr/lib/python2.7/subprocess.py", line 566, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
  OSError: [Errno 2] No such file or directory
  </code></pre>