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 -- http://mail.python.org/mailman/listinfo/python-list