mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
Un modo più veloce per trovare le persone nel db
This commit is contained in:
parent
9465fa3755
commit
3c4cd694f1
1 changed files with 17 additions and 0 deletions
17
db.py
Normal file
17
db.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
import json
|
||||
|
||||
db = json.load("db.json")
|
||||
|
||||
def findname(name: str):
|
||||
for player in db:
|
||||
if player == name:
|
||||
return db[player]
|
||||
else:
|
||||
return None
|
||||
|
||||
def findbykey(key, value):
|
||||
for player in db:
|
||||
if player[key] == value:
|
||||
return db[player]
|
||||
else:
|
||||
return None
|
Loading…
Reference in a new issue