#-*-encoding:utf-8-*-
import tablib
output = open('data.xls', 'wb')#写的是二进制文件
imported_data = tablib.Dataset().load(open('data11.json').read())
xx = imported_data.xls
output.write(xx)
output.close()
用到tablib库,文档如下
http://docs.python-tablib.org/en/latest/tutorial/#exporting-data
网友评论