how to clean sys.path

Laszlo Nagy gandalf at designaproduct.biz
Tue Jan 9 13:29:16 EST 2007


>
> So far, I know only the command >>>sys.path.append(r'c:....etc...'), but how 
> to delete or insert at the beginning of the list, I know not.
>   
You can delete a slice. For example,

del sys.path[2:5]

More about slicing: http://docs.python.org/ref/slicings.html
sys.path is a regular list. List methods: 
http://docs.python.org/tut/node7.html

Best,

   Laszlo




More information about the Python-list mailing list