从这里关闭代码:https ://gist.github.com/cspickert/1650271 而不是print
ing,我想写入 csv 文件。
在底部添加了这个:
# Request a file-like object containing the spreadsheet's contents
csv_file = gs.download(ss)
# Write CSV object to a file
with open('test.csv', 'wb') as fp:
a = csv.writer(fp, delimiter=',')
a.writerows(csv_file)
也许我需要先对 csv_file 进行转换才能写?