Answers for "can i store a json file inside an object python"

2

python write to json with indent

import json

# alphabetic dictionary
json_data = {hex(k): chr(k) for k in range(ord('a'), ord('z') + 1)}
# to file
with open("my_json.json", "w") as file:
    json.dump(json_data, file, indent=4, sort_keys=True)
Posted by: Guest on June-29-2020
6

python json dump to file

import json
with open('data.json', 'w') as f:
    json.dump(data, f)
Posted by: Guest on August-15-2020

Code answers related to "can i store a json file inside an object python"

Code answers related to "Javascript"

Browse Popular Code Answers by Language