How to append to a json file python - the quick way import json your_dictionary = {'a_new_key': 'a_new_value'} with open('a_json.json') as a_file: data = json.load(a_file) data.update(your_dictionary) with open('a_json.json', 'w') as f: json.dump(data, f)
Comments
Post a Comment