fully-qualified namespaces?
Lenny G.
alengarbage at yahoo.com
Mon Sep 12 12:44:53 EDT 2005
Thanks George. But I have to apologize -- I think I used the wrong
term in my question. Hippo is actually a package, not a module. So I
have:
Hippo/
__init__.py
Crypto.py
Potamus.py
And inside Crypto.py, I need to access python-crypto's Crypto.Hash
package. Inside Potamus.py, I need to access Hippo.Crypto, e.g.,
Hippo/
__init__.py
Crypto.py # wants to import python-crypto's Crypto.Hash
Potamus.py # wants to import Hippo's Crypto
Can I do this? Crypto.py can't seem to access python-crypto's Crypto
namespace, because it's own namespace takes precendence. I tried using
the renaming trick inside of Crypto.py, but it still can't find the
original python-crypto Crypto. Maybe there's something I can do in the
__init__.py? Maybe something with __path__? Is there a better way to
access namespaces from the module files themselves?
Thanks,
Lenny G.
More information about the Python-list
mailing list