Добавлены публичные ключи для заверения что собеседника не подменили, также добавлена аватарка

This commit is contained in:
none
2024-02-07 21:35:12 +03:00
parent 287f34f256
commit 1355450706
3 changed files with 160 additions and 55 deletions
+20
View File
@@ -0,0 +1,20 @@
import os
import json
if not os.path.exists('db.json'):
db = {}
js = json.dumps(db, indent=2)
with open("db.json", "w") as outfile:
outfile.write(js)
print('Created new db.json')
def read_db(file = 'db.json'):
with open(file, "r", encoding="utf-8") as openfile:
db = json.load(openfile)
return db
def write_db(db, file = 'db.json'):
js = json.dumps(db, indent=2, ensure_ascii=False)
with open(file, "w", encoding="utf-8") as outfile:
outfile.write(js)