title: How can I call 'git pull' from within Python?
body: <p>Using the github webhooks, I would like to be able to pull any changes to a remote development server. At the moment, when in the appropriate directory, <code>git pull</code> gets any changes that need to be made. However, I can't figure out how to call that function from within Python. I have tried the following:</p>
  <pre class="lang-python prettyprint-override"><code>import subprocess
  process = subprocess.Popen(&quot;git pull&quot;, stdout=subprocess.PIPE)
  output = process.communicate()[0]
  </code></pre>
  <p>But this results in the following error</p>
  <pre><code>Traceback (most recent call last):
    File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
    File &quot;/usr/lib/python2.7/subprocess.py&quot;, line 679, in __init__
      errread, errwrite)
    File &quot;/usr/lib/python2.7/subprocess.py&quot;, line 1249, in _execute_child
      raise child_exception
  OSError: [Errno 2] No such file or directory
  </code></pre>
  <p>Is there a way that I can call this bash command from within Python?</p>