title: Storing subprocess.call() return value in a variable
body: <p>Im trying to get the number of lines in the output of <code>ls -l | awk '{print $1}'</code>, which is 7 as shown below.</p>
  
  <pre><code>total
  drwxrwxr-x
  drwxrwxr-x
  -rw-rw-r--
  -rw-rw-r--
  -rw-rw-r--
  -rw-r--r--
  </code></pre>
  
  <p>I tried to store this value in the variable <code>count</code> but when I print count, the value is 0 instead of 7. I don't know why. </p>
  
  <pre><code>import subprocess
  
  count = subprocess.call('ls -l | awk '{print $1}' | wc -l', shell=True)
  print count
  </code></pre>
  
  <p>OUTPUT:</p>
  
  <pre><code>7
  0
  </code></pre>