If you need to extend your PATH variable, I have used this in the past.
<This should not require a reboot.>
~~~~~~~~~~~~~~~~~~
def AddSysPath(new_path):
       new_path = os.path.abspath(new_path)
       do = -1
       if os.path.exists(new_path):
               do = 1
               # check against all paths currently available
               for x in sys.path:
                       x = os.path.abspath(x)
                       if sys.platform == 'win32':
                               x = x.lower()
                       if new_path in (x, x + os.sep):
                               do = 0
               # add path if we don't already have it
               if do:
                       sys.path.append(new_path)
                       pass

       return do

On 2/3/07, Stef Mientki <[EMAIL PROTECTED]> wrote:

Is it possible to change the searchpath for modules on the flight,
under winXP ?
Most preferred is some command to extend the searchpath.
(the environment variable PYTHONPATH needs a reboot)

thanks,
Stef Mientki
--
http://mail.python.org/mailman/listinfo/python-list

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to