title: execfile with automatic relative path
body: <p>I need to be able to call python scripts via execfile() from outside the working directory without specifying the relative file path each time through the interpreter.</p>
  
  <p>instead of:</p>
  
  <pre><code>execfile("..\\UserScripts\\HelloWorld.py")
  </code></pre>
  
  <p>I need to call:</p>
  
  <pre><code>execfile("HelloWorld.py")
  </code></pre>
  
  <p>is there a sys.path I can add this to that makes this work? The directories are fixed, as are the locations of the working directory and the file. The expectation is that a user can drop a file into the UserScripts directory and expect to be able to call it through the interpreter without the relative file path.</p>