diff --git a/leaderboard.py b/leaderboard.py index 8be0bf8..7a0f8b7 100644 --- a/leaderboard.py +++ b/leaderboard.py @@ -14,12 +14,15 @@ if __name__ == "__main__": args = vars(parser.parse_args()) # If not specified, then use today's date - DATE = args.get("date", str(datetime.today().date())) + DATE = args.get("date") + if DATE is None: + DATE = str(datetime.today().date()) 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") + print(f"High scores for date '{DATE}'") for username, score in res.fetchall(): print(username, score) finally: