David Lyon wrote: > On Mon, 18 May 2009 14:34:33 +0200, Philipp Hagemeister <phi...@phihag.de> > wrote: >> Yes, but that processing will add /example/ to sys.path, right? > > It actually works the other way around. The directories listed in > sys.path are scanned for .pth files.
No, they are not. That's exactly my point. According to Christian Heimes, *some* of the directories listed in sys.path are scanned. "" is in sys.path, but is not scanned. > You can add packages by listing them inside a .PTH. > >> I'm expecting .pth files in the current directory to be be processed, >> according to docs/install/. Christian Heimes already pointed out this is >> not the case; so I'm wondering whether this is a mistake in the >> documentation or just my faulty logic. > > Perphaps you don't understand them yet. > > .PTH files are for adding run-time packages. > > May I ask why you are playing with .PTH files? they are a fairly > advanced sort of concept for describing where packages are located > to the python interpreter. > > If you are using .PTH files... you should be using "import .." > inside your code.. I know that, and I want to use them for an application consisting of multiple scripts, like so: / mylib/ somescripts/ script1.py script2.py mylib.pth (contains '../mylib/') otherscripts/ oscript1.py oscript2.py mylib.pth (contains '../mylib/') If you want, you can change the final point in my original post to: 1&3&5 => 6) echo /example/ > test.pth;touch /example/libfoo.py; python -c 'import libfoo' Cheers, Philipp
signature.asc
Description: OpenPGP digital signature
-- http://mail.python.org/mailman/listinfo/python-list