How to write List Object to a File??

ed_tsang at yahoo.com ed_tsang at yahoo.com
Tue Apr 24 18:23:50 EDT 2001


I currently have a list and woulr like to store the contents into a 
text fiel whihc I can read back ... 

For example:
a = ['a','b','c','d']
#do something like
fd = open('txt.txt','w')
fd.write(a)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: read-only buffer, list

What to do??
And I can't use pickle ...







More information about the Python-list mailing list