RE: [Zope] Another import doesn't find the module
28 May
2003
28 May
'03
6:37 p.m.
[ Dylan Reinhardt]
That's not how it's *supposed* to work...
Your choices (as I recall them) are:
from [<package>.]*<module> import <name> [as <new_name>]
- or -
import [<package>.]*<module> [as <new_name>]
Either way, the thing you import or import from should be a module.
No, you can also import names directly from a package - as long as they are defined in the __init__.py. And you can import a package itself. Here is working code from my Extensions directory that illustrates the point. "gcm is a __package__, and "code" is a package nested under "gcm". gcmdriver is a module in gcm\code. from gcm.code import gcmdriver from gcm import BASEPATH The following also work - import gcm.code from gcm import code Cheers, Tom P
8348
Age (days ago)
8348
Last active (days ago)
0 comments
1 participants
participants (1)
-
Passin, Tom