Module rfc822 - uses file-objects - why?

Fredrik Lundh fredrik at pythonware.com
Thu Feb 22 12:43:15 EST 2001


Thomas Volkmar Worm wrote:
> I started to write a little programm which reads mails from a POP3
> account. To handle the message I thought, I use the rfc822 module or one
> of its subclasses (mimetools). But the methods I want to use always
> expect file-objects as parameters. Do I need to store every list/string
> onto disk when I want to use these classes or methods on them?

import StringIO
file = StringIO.StringIO(data)

see the library reference for details.

Cheers /F

<!-- (the eff-bot guide to) the standard python library:
http://www.pythonware.com/people/fredrik/librarybook.htm
-->






More information about the Python-list mailing list