Ako previesť textový súbor do formáte json v jazyku python
Príklady kódu
0
0
N
# Directly from dictionary
with open('json_data.json', 'w') as outfile:
json.dump(json_string, outfile)
# Using a JSON string
with open('json_data.json', 'w') as outfile:
outfile.write(json_string)