728x90
JSON
-
[Python/Module] JSON코딩/Python 2022. 12. 22. 13:58
JSON syntax for storing and exchanging data text, JavaScript object notation import json # some JSON: x = '{ "name":"John", "age":30, "city":"New York"}' # parse x: y = json.loads(x) # the result is a Python dictionary: print(y["age"]) Parse JSON - Convert from JSON to Python: json.loads() result: dictionary Convert from Python to JSON: json.dumps() import json # a Python object (dict): x = { "n..