title: python subprocess Popen environment PATH?
body: <p>Suppose there's an executable and a Python script to launch it, and they're located in 'sibling' subdirectories, e.g.</p>
  <pre><code>/tmp/subdir1/myexecutable
  /tmp/subdir2/myscript.py
  </code></pre>
  <p>If in <code>/tmp</code> and running <code>python subdir2/myscript.py</code> with a relative path to executable</p>
  <pre><code># myscript.py
  from subprocess import Popen
  proc = Popen([&quot;../subdir1/myexecutable&quot;])
  </code></pre>
  <p>It makes <code>OSError: [Errno 2] No such file or directory</code>.</p>
  <p>How does the Python search for the executable? Does it use the current working directory and/or location of the script? Does it use PATH and/or PYTHONPATH? Can you change where and how <code>subprocess.Popen</code> searches for the executable? Are commands, absolute and relative paths for executables treated differently? Are there differences between Linux and Windows? What does <code>shell=True</code> or <code>shell=False</code> influence?</p>