Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 12 years ago

calc314 gravatar image

Another option is the use the csv package in python. You can write using this as follows. In the snippet below, info is a list of lists containing data that you want to write to a file.

import csv
info=[[1,2,3],[4,5,6]]
writefile = csv.writer(open(DATA+'myfile.csv', 'w'))
for i in range(0,len(info)): 
      writefile.writerow(info[i])
click to hide/show revision 2
No.2 Revision

Another option is the use the csv package in python. You can write using this as follows. In the snippet below, info is a list of lists containing data that you want to write to a file.

import csv
info=[[1,2,3],[4,5,6]]
writefile = csv.writer(open(DATA+'myfile.csv', 'w'))
for i in range(0,len(info)): 
      writefile.writerow(info[i])

This will result in a .csv file that Excel can read.