I try to parse a JSON string
Code: Select all
{ "name": "United States", "population": 331002651, "capital": "Washington D.C.", "languages": [ "English", "Spanish" ]}
Code: Select all
# -*_ coding: utf-8 _*_from __future__
import unicode_literals
import uno
import json
def read_value(*args):
json_content = json.loads(args[0])
json_key = args[1]
json_val = json_content[json_key]
return json_val
g_exportedScripts = read_value,
Thanks