Skip to content
Related Articles
Get the best out of our app
Open App

Related Articles

GUI Application for Live Cricket scoreboard Using Python

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

In this article, we will see how module is imported and implemented to produce scoreboard of a specified sport like baseball, basketball, cricket and many more along with other details about the sport. Code examples in the text below revolve around cricket, you can perform the same operation for any other sport. Scrapes data from:


Not all sports are supported by this module, all of which are supported are listed below along with their respective python code to reference them:



Baseball sports.BASEBALL
Basketball sports.BASKETBALL
Cricket sports.CRICKET
Handball sports.HANDBALL
Football sports.FOOTBALL
Hockey  sports.HOCKEY
Rugby Union  sports.RUGBY_U
Rugby League sports.RUGBY_L
Soccer sports.SOCCER
Tennis sports.TENNIS
Volleyball sports.VOLLEYBALL


First, we need to install this module and for that just simply run the following code into your terminal:

pip install


  • import module
  • Get a single match using get_match()


get_match(sport, team1, team2)

get_match() returns a single Match object which contains the following properties:



sport Name of the sport
league League of the match
home_team Home team
away_team Away team
home_score Home team score
away_score Away team score
match_time Current match time
match_date Date on which the match was played
match_link Link to an XML file containing match data

Example 1:


# import module
import sports
# setting sport


Example 2:

Program that prints all live cricket matches.


# import module
import sports
# extracting information
matches = sports.get_sport(sports.CRICKET)
#printing all matches
for item in matches:



Example 3:

An application that produces cricket live scores using tkinter in a GUI format.


# import modules
from tkinter import *
import sports
from tkinter import messagebox
def cricket_info():
        match = sports.get_match(sports.CRICKET, e1.get() , e2.get())
        messagebox.showerror("showerror", "No match found")
# object of tkinter
# and background set for light grey
master = Tk()
master.configure(bg='light grey')
# Variable Classes in tkinter
date = StringVar();
time = StringVar();
league = StringVar();
team1 = StringVar();
team2 = StringVar();
team1_score = StringVar();
team2_score = StringVar();
link = StringVar();
# Creating label for each information
# name using widget Label
Label(master, text="Team 1 :" , bg = "light grey").grid(row=0, sticky=W)
Label(master, text="Team 2 :" , bg = "light grey").grid(row=1, sticky=W)
Label(master, text="Date :" , bg = "light grey").grid(row=2, sticky=W)
Label(master, text="Time :", bg = "light grey").grid(row=3, sticky=W)
Label(master, text="League :", bg = "light grey").grid(row=4, sticky=W)
Label(master, text="Team 1 :", bg = "light grey").grid(row=5, sticky=W)
Label(master, text="Team 2 :", bg = "light grey").grid(row=6, sticky=W)
Label(master, text="Team 1 score :", bg = "light grey").grid(row=7, sticky=W)
Label(master, text="Team 2 score :", bg = "light grey").grid(row=8, sticky=W)
Label(master, text="Link :", bg = "light grey").grid(row=9, sticky=W)
# Creating label for class variable
# name using widget Entry
Label(master, text="", textvariable= date ,bg = "light grey").grid(row=2,column=1, sticky=W)
Label(master, text="", textvariable= time ,bg = "light grey").grid(row=3,column=1, sticky=W)
Label(master, text="", textvariable= league ,bg = "light grey").grid(row=4,column=1, sticky=W)
Label(master, text="", textvariable= team1 ,bg = "light grey").grid(row=5,column=1, sticky=W)
Label(master, text="", textvariable= team2 ,bg = "light grey").grid(row=6,column=1, sticky=W)
Label(master, text="", textvariable= team1_score ,bg = "light grey").grid(row=7,column=1, sticky=W)
Label(master, text="", textvariable= team2_score ,bg = "light grey").grid(row=8,column=1, sticky=W)
Label(master, text="", textvariable= link ,bg = "light grey").grid(row=9,column=1, sticky=W)
e1 = Entry(master)
e1.grid(row=0, column=1)
e2 = Entry(master)
e2.grid(row=1, column=1)
# creating a button using the widget 
# Button that will call the submit function
b = Button(master, text="Show", command=cricket_info )
b.grid(row=0, column=2,columnspan=2, rowspan=2,padx=5, pady=5)


My Personal Notes arrow_drop_up
Last Updated : 04 Dec, 2021
Like Article
Save Article
Similar Reads
Related Tutorials