Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

a. Try a csv file. You can read and write as follows

writing:

with open('yourfile.csv', 'w') as f1:
writefile = csv.writer(f1)
writefile.writerows(data_list)

reading:

import csv
with open('your file.csv','rU') as f1:
    data=list( csv.reader(f1) )

b. saving a more complex data format

Try using save and load.

save(data,'myfile')

result=load('myfile')