python json save to file
snippet in javascript

json dump to file

user6392

import json

data = {"key": "value"}

with open('data.json', 'w') as jsonfile:
    json.dump(data, jsonfile)

python json save to file

user1614

with open('output.json', 'w') as outfile:
    json.dump(data, outfile)

save json to file

user8732

import json

data = {}

with open('data.txt', 'w') as outfile:
    json.dump(data, outfile)