[Pythonmac-SIG] sys.path on Leopard
Boyd Waters
bwaters at nrao.edu
Fri Nov 2 00:33:54 CET 2007
Sorry I don't know the answer to this, but...
Are you saying that there are two passes in the sys.path resolution?
first pass: go through the sys.path elements and parse (execute)
the .pth files
second pass: load things
Actually I suppose there is no "second pass" -- it's just that .pth
files are executed *before* modules are loaded.
Is that right?
SO that modifying the order of sys.path elements works as expected?
On Nov 1, 2007, at 2:14 PM, Jack Jansen wrote:
> I put the following line (without indentation) into ~/Library/Python/
> 2.5/site-packages/HackPath.pth
> import sys ; sys.path.insert(0, '/Users/jack/MyPythonPrependedPath')
> And, indeed, '/Users/jack/MyPythonPrependedPath' ends up as the first
> entry in sys.path.
More information about the Pythonmac-SIG
mailing list