I have a list of values (v1, v2, v3) and I want to write these to a column called VALUES in a csv. I'm using csvreader and csvwriter to get as far as I have. I've only figured out how to write them to rows using csvwriter.writerow.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
It sounds like you have tried:
values = [1, 2, 3, 4, 5] thecsv = csv.writer(open("your.csv", 'wb')) thecsv.writerow(values)
Perhaps you should try:
values = [1, 2, 3, 4, 5] thecsv = csv.writer(open("your.csv", 'wb')) for value in values: thecsv.writerow(value)