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
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
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
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