python čítať súbor json
import json
with open('path_to_file/person.json') as f:
data = json.load(f)
print(data)
otvorte súbor JSON python
import json
with open('data.txt') as json_file:
data = json.load(json_file)
napíšte dict do JSON python
import json
with open('result.json', 'w') as fp:
json.dump(sample, fp)
zaťaženie json zo súboru python 3
import json
with open('file_to_load.json', 'r') as file:
data = json.load(file)
uložiť dict do JSON python
import json
with open('data.json', 'w') as fp:
json.dump(data, fp)
súbor json do dict python
import json
with open("data.json", "r") as json_file:
my_dict = json.load(json_file)