Setting search path

Costas Menico costas at meezon.com
Fri May 11 15:38:15 EDT 2001


"michael montagne" <montagne at boora.com> wrote:

>I need some advice on the best way to handle this on WinNT.  I really
>getting excited about Python and I'm thinking I'll use it more and more.
>But for each person in the offfice (100 people), I need to install Python on
>their machines.  I'd like to create a directory on the network for all my
>scripts, modules, and packages.  That way I can update the code in one place
>and all my users can share the same files.  I'll still need a development
>path so on my machine I'd need another directory in front of the shared one.
>This also keeps all my code safe from upgrade overwrites.  I've read about
>.pth files but I'm not sure that is best in my case.
>What is the standard way to handle this issue?
>

The search path for the scripts is defined in he sys module.

import sys
print sys.path

You can add your own to this path as follows:

sys.path.append('c:\\mydevelopment')

to add to end of earch or 

sys.path.insert(0,'c:\\mydevelopment')

to add to start of search

Double BS are required anytime you put a BS in a string.

Costas






More information about the Python-list mailing list