adding a directory to sys.path

Christian Heimes lists at cheimes.de
Mon Nov 23 13:15:10 EST 2009


John Guenther schrieb:
> This is Mac related. I am running snow leopard. I am using Python 2.6.3.
> 
> I had a lot of difficulty figuring out how to add a directory to sys.path that would be there every time I launched Idle. I have a directory called PythonPrograms in my Documents folder. When I installed Python it had '/Users/johnguenther/Documents' as sys.path[0]. I tried setting PYTHONPATH and this worked for running Python  from the bash shell but only until I exited the shell. PYTHONPATH had to be reset each time I restarted the shell. And it had no effect on sys.path when I ran Idle.

See my blog posting:
http://lipyrary.blogspot.com/2009/08/how-to-add-new-module-search-path.html

Christian



More information about the Python-list mailing list