Writev
Steven Bethard
steven.bethard at gmail.com
Mon Dec 20 00:30:15 EST 2004
Adam DePrince wrote:
> Many other programmers have faced a similar issue; cStringIO,
> ''.join([mydata]), map( file.write, [mydata]) are but some attempts at
> making this process more efficient by jamming the components to be
> written into a sequence.
I'm obviously misunderstanding something because I can't figure out why
you would write:
map(file.write, [mydata])
instead of
file.write(mydata)
Is your task to write a sequence/iterator of items into a file? I would
expect your example to look like:
map(file.write, mydata)
which I would write as:
file.writelines(mydata)
Could you explain a little more what your intent is here?
Steve
More information about the Python-list
mailing list