http://docs.python.org/lib/node588.html says:
----------------------
Each of these classes should be imported from a module
with the same name as the class, from within the email
package. E.g.:
import email.MIMEImage.MIMEImage
or
from email.MIMEText import MIMEText
----------------------
However, here is a Python IDLE session showing that
the first import format doesn't work:
----------------------
Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310
32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more
information.
<snip>
IDLE 1.1.3
>>> import email.MIMEImage.MIMEImage
Traceback (most recent call last):
File "<pyshell#0>", line 1, in -toplevel-
import email.MIMEImage.MIMEImage
ImportError: No module named MIMEImage
>>>
----------------------
This method *does* work:
----------------------
>>> import email.MIMEImage
>>>
----------------------
This got one of my inexperienced programmers tied up
in knots!
Hugh
|