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

Lulu of the Lotus-Eaters mertz at gnosis.cx
Fri Aug 10 08:35:28 CEST 2001


Grant R. Griffin wrote
   >>> l=[0,1,2,3,4]
   >>> f=open('e', 'w')
   >>> f.write(l)
   Traceback (most recent call last):
     File "<stdin>", line 1, in ?
   TypeError: read-only character buffer, list

One could, of course, do the below:

  >>> l = [0,1,2,3,4]
  >>> f = open('e','w')
  >>> f.write(''.join(map(str,l)))

Yours, Lulu...




More information about the Python-list mailing list