1import json
2
3with open('path_to_file/person.json') as f:
4 data = json.load(f)
1import json
2
3with open('path_to_file/person.json') as f:
4 data = json.load(f)
5
6print(data)
1require "json"
2json_from_file = File.read("myfile.json")
3hash = JSON.parse(json_from_file)
1import json
2
3data = {"key": "value"}
4
5with open('data.json', 'w') as jsonfile:
6 json.dump(data, jsonfile)
7
1import json
2
3with open('path_to_file/person.json') as f:
4 data = json.load(f)
5print(data)
6
7flx = json.dumps(data, ensure_ascii=False, indent=4)
8print(flx)