I am currently working on a python bottle app and have built an array like the one below in Python.
[{'text': 'aampm', 'size': 1}, {'text': 'absolutely', 'size': 1},...
I added this to a json object using json.dumps() and then trying to pass the value to the front end using template like the following:
return template('example',
word_cloud = word_cloud)
Within the javascript area, I load the file using the following:
var cloud = JSON.parse({{word_cloud}});
But I am getting an issue because it is returning the list like this and replace the "'" with """.
var cloud = JSON.parse([{"text": "aampm", "size": 1}, {"text"
How do I make it so that it loads in the right format -
([{'text': 'word', 'size': 5}, {'text': 'cloud', 'size': 15}])