title: How to get the current Python interpreter path from inside a Python script?
body: <p>I want to run a Python script from a Python script with <code>subprocess</code>, and I wish to do it using the same interpreter for each of them.</p>
  
  <p>I'm using virtualenv, so I'd like to do something like:</p>
  
  <pre><code>subprocess.Popen('%s script.py' % python_bin)
  </code></pre>
  
  <p>How do I get <code>python_bin</code>?</p>
  
  <p>It should be <code>/usr/bin/python</code> outside a virtualenv, and <code>/path/to/env/bin/python</code> in a virtualenv.</p>