If you need to extend your PATH variable, I have used this in the past. <This should not require a reboot.> <br>~~~~~~~~~~~~~~~~~~<br>def AddSysPath(new_path):<br> new_path = os.path.abspath(new_path)<br> do = -1
<br> if os.path.exists(new_path):<br> do = 1<br> # check against all paths currently available<br> for x in sys.path:<br> x = os.path.abspath(x)<br>
if sys.platform == 'win32':<br> x = x.lower()<br> if new_path in (x, x + os.sep):<br> do = 0<br> # add path if we don't already have it
<br> if do:<br> sys.path.append(new_path)<br> pass<br><br> return do<br><br><div><span class="gmail_quote">On 2/3/07, <b class="gmail_sendername">Stef Mientki
</b> <<a href="mailto:S.Mientki-nospam@mailbox.kun.nl">S.Mientki-nospam@mailbox.kun.nl</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Is it possible to change the searchpath for modules on the flight,<br>under winXP ?<br>Most preferred is some command to extend the searchpath.<br>(the environment variable PYTHONPATH needs a reboot)<br><br>thanks,<br>Stef Mientki
<br>--<br><a href="http://mail.python.org/mailman/listinfo/python-list">http://mail.python.org/mailman/listinfo/python-list</a><br></blockquote></div><br>