title: adding directory to sys.path /PYTHONPATH
body: <p>I am trying to import a module from a particular directory. </p>
  
  <p>The problem is that if I use <code>sys.path.append(mod_directory)</code> to append the path and then open the python interpreter, the directory <code>mod_directory</code> gets added to the end of the list sys.path. If I export the <code>PYTHONPATH</code> variable before opening the python interpreter, the  directory gets added to the start of the list. In the latter case I can import the module but in the former, I cannot.</p>
  
  <p>Can somebody explain why this is happening and give me a solution to add the <code>mod_directory</code> to the start, <em>inside</em> a python script ?</p>