我试过从另一个问题得到的一些代码(listofpaths是我在代码前面生成的一个列表)
myfile = open('/home/graham/Desktop/Experiment/listcsv.csv', 'wb')
wr = csv.writer(myfile, quoting=csv.QUOTE_ALL)
wr.writerow(list_of_paths)
但它把整个名单放在一个单元格里。我想把每一项放在不同的一行。我用于CSV文件的程序是libreofficecalc,如果这有区别的话。你知道吗
Tags:
我将使用标准的输入/输出来实现这一点。你知道吗
如果列表中的每个元素都是一个列表或元组。。可以使用join命令将它们分隔为列。你知道吗
使用
writerows
如下:相关问题 更多 >
编程相关推荐