title: How to get variable from subprocess.call in Python?
body: <p>I'm trying to count the number of lines that start with ">" using grep and then store that value as a <code>Python</code> integer object [<code>int</code>].  I'm running the command with <code>subprocess</code> using the <code>call</code> method.</p>
  
  <pre><code>In [8]: x = subprocess.call(f"grep -c '^&gt;' {path}", shell=True)
  4626
  
  In [9]: x
  Out[9]: 0
  </code></pre>
  
  <p>It's going to <code>stdout</code> but I want it to go into the variable <code>x</code>. </p>