[Tutor] Possible to import imports?
robert.d.kirkpatrick at gmail.com
Mon Jun 23 19:27:13 CEST 2008
I've googled a bit and tried some things on my own, but can't seem to
determine if it's possible to declare some standard library imports in one
package/module then import that package/module somewhere else and reap the
benefit of those initial imports.
For example, if I have a setup like this:
Could I put "import datetime" in foo's __init__.py and do an import of foo
from hello.py and start using datetime in hello.py without importing
datetime specifically in hello.py? All the examples I see import all the
necessary standard library mods in the script/module that specifically uses
them so either what I want to do is not possible or a bad idea. Thoughts?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor