From 04553a4884019ec8bc5980fe19950f86b0b2decc Mon Sep 17 00:00:00 2001 From: Dave Smith-Hayes Date: Sat, 15 Mar 2025 21:34:07 -0400 Subject: [PATCH] Get only the score for a specific team --- main.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 2586f9d..55929a0 100644 --- a/main.py +++ b/main.py @@ -26,12 +26,18 @@ def main(): required=False) args = arg_parser.parse_args() + events = init_games() if args.team: - # find the team - print(args.team) + found_event= filter(lambda e: e.home_team.abbr.lower() == args.team.lower() or e.away_team.abbr.lower() == args.team.lower(), events) + if found_event: + event = list(found_event).pop() + table = output_game(event) + console.print(table) + else: + print(f"Team not found: {args.team}") else: - for event in init_games(): + for event in events: table = output_game(event) console.print(table)