I\'ve been using the JSON library for Python to get data from JSON files using Python.
infoFromJson = json.loads(jsonfile)
I fully understand h
Try the following:
infoFromJson = json.loads(jsonfile)
print json2html.convert(json = infoFromJson)
The result from json2html.convert
is a string.
If you don't have json2html module:
$ pip install json2html
More examples here.
Nowadays it's better to use json2table (at least for Python 3)
import json2table
import json
infoFromJson = json.loads(jsonfile)
build_direction = "LEFT_TO_RIGHT"
table_attributes = {"style": "width:100%"}
print(json2table.convert(infoFromJson,
build_direction=build_direction,
table_attributes=table_attributes))