Created
November 6, 2020 20:39
-
-
Save nimit2801/ff9e12c81e6309df1fdc4b434fbb540c to your computer and use it in GitHub Desktop.
This Gist helps you to use json as your database with python. Its basic but you can develop things on this!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
with open("person.json", "r") as json_read: | |
json_dict = json.load(json_read) | |
name = input("enter your name: ") | |
json_dict["name"] = name | |
print(json_dict["name"]) | |
person_dict = json_dict | |
with open('person.json', 'w') as json_file: | |
json.dump(person_dict, json_file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"name": "zombie", "languages": ["English", "Fench"], "married": true, "age": 32} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment