slow joinings of strings

Thomas Wouters thomas at xs4all.net
Tue Jan 30 08:16:43 EST 2001


On Tue, Jan 30, 2001 at 01:46:04PM +0100, Karol Bryd wrote:
> > This should be faster:

> > s = open(file, 'r').read()

> Ok, this works fine as long as I want to read whole file at once,
> but in my case, unfortunately, I need to read file part by part
> (the file is RFC822 message, and I want to extract some MIME parts
> from it).

Have you considered using the rfc822 module, or one of the MIME-parsing
packages ? There's 'mimetools' in the standard library, there's mimectl as a
separate module (http://starship.python.net/~arcege/modules/) and Barry
Warsaw started work on something he has given the rather uninspiring name
'mimelib': http://barry.wooz.org/software/pyware.html

-- 
Thomas Wouters <thomas at xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!




More information about the Python-list mailing list