mirror of
https://github.com/brandon-rozek/wordguess
synced 2025-11-02 22:41:12 +00:00
Initial draft
This commit is contained in:
commit
87986d4b2a
8 changed files with 6457 additions and 0 deletions
24
leaderboard.py
Normal file
24
leaderboard.py
Normal 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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue