How do I add permanently to Pythons sys.path?

cnb circularfunc at yahoo.se
Tue Sep 16 17:38:44 CEST 2008


On Sep 16, 5:25 pm, Python <pyt... at rgbaz.eu> wrote:
> On 16 sep 2008, at 17:13, cnb wrote:
>
>
>
> >>>> sys.path
> > ['C:\\Python25\\Progs\\NatLangProc', 'C:\\Python25\\Lib\\idlelib',  
> > 'C:\
> > \Windows\\system32\\python25.zip', 'C:\\Python25\\lib\\site-packages\
> > \orange', 'C:\\Python25\\lib\\site-packages\\orange\\OrangeWidgets',
> > 'C:\\Python25\\lib\\site-packages\\orange\\OrangeCanvas', 'C:\
> > \Python25\\DLLs', 'C:\\Python25\\lib', 'C:\\Python25\\lib\\plat-win',
> > 'C:\\Python25\\lib\\lib-tk', 'C:\\Python25', 'C:\\Python25\\lib\\site-
> > packages', 'C:\\Python25\\lib\\site-packages\\Numeric', 'C:\\Python25\
> > \lib\\site-packages\\PIL']
>
> > Now I have my personal programs in C:/Python25/Progs/
>
> > How do I add so that I can just do "import somefile" from anywhere in
> > that directory in the interpreter and it can load files from other
> > folders in that directory.
> > --
> >http://mail.python.org/mailman/listinfo/python-list
>
> a temp solution is to append it to that list:
>
> sys.path.append('C:/Python25/Progs/')
>
> a permanent solution is to add it to the environment variable
> (no idea where to set this in windows)
> $PYTHONPATH = "/C:/Python25/Progs/"
>
> gr
> Arno

but since Python25/ is in my path it only seems to import from that
exact dir, not dirs inside the dir.

so i have to do somerthing like /progs/* ?


and also, temporary adding doesnt seem to work.



More information about the Python-list mailing list