Mohamed Yousef wrote:
Python doesn't use a global namespace -- importing a given module into
one module doesn't make it visible everywhere else (and trust me, this
is a very good thing).
(it uses a global module cache, though, so it's only the first import
that actually loads the module)
to do that, add "import re" to the top of the C module.
see this page for a little more on Python's import mechanism:
</F>
why am i doing this in the first place
I'm in the process of a medium project where imports of modules start
to make a jungle and i wanted all needed imports to be in a single
file (namely __init__.py)
and then all imports are made once and other modules feel it
I'm in the process of a medium project where imports of modules start
to make a jungle and i wanted all needed imports to be in a single
file (namely __init__.py)
and then all imports are made once and other modules feel it
one module doesn't make it visible everywhere else (and trust me, this
is a very good thing).
(it uses a global module cache, though, so it's only the first import
that actually loads the module)
my goal is basically making W() aware of the re module when called
from A
from A
see this page for a little more on Python's import mechanism:
</F>