Move db to home path

This commit is contained in:
2026-06-11 13:17:59 +03:00
parent 46b42760d9
commit de0cc23ab9
2 changed files with 17 additions and 7 deletions
+7 -2
View File
@@ -1,8 +1,13 @@
#Get home dir
from subprocess import getoutput
global home
home = getoutput("echo $HOME")
#Json
import json
def read():
global db
with open('db.json', 'r') as openfile:
global db, home
with open(f'{home}/db.json', 'r') as openfile:
db = json.load(openfile)