【发布时间】:2012-07-26 06:53:03
【问题描述】:
我可以使用以下代码保存 Excel 文件:
f = cStringIO.StringIO() # This is a buffer to Store the above values
wb.save(f) # This will save the buffer
output_data=base64.encodestring(f.getvalue())
res = self.write(cr, uid, ids, {'state':'get','data':output_data, 'name':'kpi.xls'}, context=context)
return res
但我无法使用另存为向导保存 CSV 文件。
【问题讨论】:
-
我只想将文件保存在系统中的任何特定位置。就像下载向导一样。
-
您的代码不完整。貌似是某个类的一部分,但你粘贴的方法也不完整。
标签: python excel csv python-2.7