get-a-cup-of-coffee slow (fwd)

Quinn Dunkan quinn at retch.ugcs.caltech.edu
Thu Aug 9 20:05:44 EDT 2001


On Thu, 09 Aug 2001 18:12:31 -0400, Lulu of the Lotus-Eaters <mertz at gnosis.cx>
wrote:
>Grant Griffin wrote:
>|Also, I tried writing something like this with a list (which are presumably more
>|suited to being appended), but then I realized that I didn't know how to write
>|the contents of a list to a file as a stream of bytes.  There's probably a
>|simple way to do that: what is it?
>
>''.join(lst)         # Python 2.0+
>string.join(lst,'')  # Python 1.4+ (or something)

There is also file.writelines(lst).  It's not documented in my version of
python, so maybe you're not supposed to use it, but why put it there then?
It's been there for quite a while now.



More information about the Python-list mailing list