Answers for "insert json file in python"

1

insert json file in python

a_dictionary = {"d": 4}

with open("sample_file.json", "r+") as file:
    data = json.load(file)	# get data from file
    update(a_dictionary)
    seek(0)
    json.dump(data, file)	# insert data in file
Posted by: Guest on November-19-2020
0

how to add items to an existing json file python

a_dictionary = {"d": 4}

with open("sample_file.json", "r+") as file:
    data = json.load(file)
    update(a_dictionary)
    seek(0)
    dump(data, file)
Posted by: Guest on October-29-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language