1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-27 13:34:28 +00:00

Un modo più veloce per trovare le persone nel db

This commit is contained in:
Steffo 2016-10-03 09:51:12 +02:00 committed by GitHub
parent 9465fa3755
commit 3c4cd694f1

17
db.py Normal file
View 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