how to change sys.path?

Steve Holden steve at
Wed May 24 12:56:06 CEST 2006

Ju Hui wrote:
> yes, we can change PYTHONPATH to add some path to sys.path value, but
> how to remove item from sys.path?
That would be

del sys.path[3]

for example. Of course you may need to search sys.path to determine the 
exact element you need to delete, but sys.path is just like any other 
list in Python and can (as many people have already said in this thread) 
be manipulated just like al the others.

Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC/Ltd
Love me, love my blog
Recent Ramblings

More information about the Python-list mailing list