title: Calling a bash command via python
body: <p>I have a command in bash: </p>
  
  <pre><code>fslstats /Users/Downloads/ALLSITES/3dROIMaker/network3*_GM.nii.gz -l 1.5 -u 2.5 -V | cut -d ' ' -f 1
  </code></pre>
  
  <p>output: 755</p>
  
  <p>If I'm now in python trying to run the same command: </p>
  
  <pre><code> for qq in range (0, 5, 1): 
        lo = glob.glob(path2 + "IM" + path1 + "*_GM.nii.gz")  
        lo = ' '.join(lo)
        lower = qq - 0.5
        upper = qq + 0.5
        subprocess.check_output(['fslstats {} -l lower -u upper -V | cut -d ' ' -f 1'.format(lo)], shell=True)
  </code></pre>
  
  <p>I get this error: 
  returned non-zero exit status 1)</p>
  
  <p>Why is this?</p>