问题
Does anyone know how can I convert JSON to XLS in Python?
I know that it is possible to create xls files using the package xlwt in Python.
What if I want convert a JSON data convert to XLS file directly?
Is there a way to archive this?
回答1:
I usually use tablib for this use. Its pretty simple to use: https://pypi.python.org/pypi/tablib/0.9.3
回答2:
Using pandas (0.15.1) and openpyxl (1.8.6):
import pandas
pandas.read_json("input.json").to_excel("output.xlsx")
来源:https://stackoverflow.com/questions/15379178/how-to-convert-json-to-xls-in-python