[Tutor] COnvert a string?

Michal Molhanec molhanec@seznam.cz
Sun Jul 6 08:08:02 2003


j2 wrote:

>>you need
>>import email.Header
> 
> 
> import email should impor teverything, shouldnt it?

it depends on how is the package's __init__.py written

> 
> cookiemonster:/root/scripts# ./test.py       
> Traceback (most recent call last):
>   File "./test.py", line 5, in ?
>     import email.Header
> ImportError: No module named Header
> cookiemonster:/root/scripts# 
> cookiemonster:/root/scripts# python2.2
> Python 2.2.1 (#1, Sep  7 2002, 14:34:30) 

oops, sorry i forgot that email.Header is available since 2.2.2
in this case you probably have to use older packages like rfc822 package 
but i have no experience with it
(or you can download the new email package from 
http://mimelib.sourceforge.net/ )
(or update python :-) )