You haven't written anything back into the file. Open up the file in write mode (open("people.json", r+)
), then after you append the data, you'll need to json.dump
the new dictionary into the file.
Also, no need to do jsonFile.close()
at the end. Your with
statement deals with that.