title: Calling the "source" command from subprocess.Popen
body: <p>I have a .sh script that I call with <code>source the_script.sh</code>.  Calling this regularly is fine.  However, I am trying to call it from my python script, through <code>subprocess.Popen</code>.</p>
  
  <p>Calling it from Popen, I am getting the following errors in the following two scenario calls:</p>
  
  <pre><code>foo = subprocess.Popen("source the_script.sh")
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/usr/lib/python2.7/subprocess.py", line 672, in __init__
      errread, errwrite)
    File "/usr/lib/python2.7/subprocess.py", line 1213, in _execute_child
      raise child_exception
  OSError: [Errno 2] No such file or directory
  
  
  &gt;&gt;&gt; foo = subprocess.Popen("source the_script.sh", shell = True)
  &gt;&gt;&gt; /bin/sh: source: not found
  </code></pre>
  
  <p>What gives?  Why can't I call "source" from Popen, when I can outside of python?</p>