Initial draft

This commit is contained in:
Brandon Rozek 2024-01-05 22:30:58 -05:00
commit 87986d4b2a
No known key found for this signature in database
GPG key ID: 26E457DA82C9F480
8 changed files with 6457 additions and 0 deletions

24
leaderboard.py Normal file
View file

@ -0,0 +1,24 @@
"""
Author: Brandon Rozek
View leaderboard information for a particular date
# TODO: argparse
"""
from wordguess import WordGuess
import sqlite3
from datetime import datetime
DATE = str(datetime.today().date())
if __name__ == "__main__":
con = sqlite3.connect(WordGuess.RESULTS_LOCATION)
try:
cur = con.cursor()
res = cur.execute(f"SELECT user, score FROM scores WHERE date = '{DATE}' ORDER BY score DESC")
for username, score in res.fetchall():
print(username, score)
finally:
con.close()