Re: package search

2006-06-11 Thread imho
boris ha scritto: > > COOL! You just saved me an awful lot of work. > > Thanks, Diego! > > Boris > ;-) Bye -- http://mail.python.org/mailman/listinfo/python-list

Re: package search

2006-06-11 Thread boris
imho wrote: > > You just have to put in "__init__.py" in "lib2" (the package directory > you are "extending"), the following lines: > > from pkgutil import extend_path > __path__ = extend_path(__path__, __name__) > > "__path__", in each __init__ module, is a list initialized with the > module's pa

Re: package search

2006-06-11 Thread imho
boris ha scritto: > I have two directories, lib1 and lib2, that both contain the package > foo, one with the submodule mod1 > and the other with the submodule mod2: > [...] > Now this script: > > import sys > sys.path.append("lib1") > sys.path.append("lib2") > import foo.mod1 > > will find the mo

Re: package search

2006-06-11 Thread boris
Sybren Stuvel wrote: > Simplicity and explicitness. You have two packages 'foo', and it > simply loads the first one it finds. Yes, here you are right. It is indeed simple. Boris -- http://mail.python.org/mailman/listinfo/python-list