PYTHONPATH on PC

Steve Holden sholden at bellatlantic.net
Wed Feb 23 14:52:55 EST 2000


Let's also not forget that this kind of stuff can be put in a "sitecustomize"
module.  I use this both to add my personal directories and to remove some
annoying duplication from the path due to Windows' case-insensitivity:

"""Site customization for holdenweb.com - Windows platforms."""

import sys, string

path = sys.path[:]
sys.path = []
for p in path:
    p=string.lower(p)
    if p not in sys.path: sys.path.append(p)

sys.path.append(r"D:\Steve\Projects\Python")

regards
 Steve

David Smith wrote:
> 
> Mikael Olofsson wrote:
> 
> > I thought you were supposed to do
> >
> > import sys
> > sys.path.append('whateverpath')
> > import yourmodule
> >
> > At least that's what I do on Unix.
> 
> Yes, you're right.  That works.  And now, I don't know why I couldn't remember
> or find this: I have even been over that territory before.  I guess it's just
> part of learning a bunch of new stuff at once.  Thanks a lot.
> 
>     David Smith

--
"If computing ever stops being fun, I'll stop doing it"



More information about the Python-list mailing list