The COVID Tracking Project
Covid Tracker Application using Python
It is a simple application to track the current covid cases from different countries using python programmings.
lets start with python programming
# first we import or install python library and create a geometry window
from tkinter import*
root=Tk()
root.title(" COVID CASES IN OVERALL COUNTRY")
root.geometry("500*500")
# create a function to show the data
def data():
from covid import Covid
import matplotlib import pyplot as plt
import matplotlib.patches as mpatch
covid = Covid
confirm=[]
recover= []
case = []
active =[]
death = []
try:
root.update()
country= data.get()
country_name= country.strip()
country_name= country_name.split(' - ')
country_name= country_name.replace(" " --" --")
for x in country_name:
case.append(covid.get_show_data_by_country_name(x))
root.update()
for y in cases:
confirm.append(y["confirm"])
recover.append(y["recover"])
active.append(y["active"])
death.append(y["death"])
confirm_patch = mpatch.Patch(color = 'red', label= 'confirm')
active_patch = mpatch.Patch(color = 'black', label= 'active')
death_patch = mpatch.Patch(color = 'blue', label= 'death')
recover_patch = mpatch.Patch(color = 'green', label= 'recover')
plt.legend(handle =[ confirm_patch, active_patch, death_patch, recover_patch])
for x in range(len(country_name):
if recover[x] > active[x]:
plt.bar(country_name[x] , recover[x] ,color = 'green')
plt.bar(country_name[x] , active[x] ,color = 'black')
else:
plt.bar(country_name[x] , active[x] ,color = 'black')
plt.bar(country_name[x] , recover[x] ,color = 'green')
plt.bar(country_name[x] , death[x] ,color = 'blue')
plt.title("current_cases")
plt.xlabel("c_name")
plt.ylabel("cases")
plt.show()
except Exception as e:
print("enter the information")
Label(root, text="enter the country name",font="Consolas 18 bold").pack()
Label(root, text=" enter the details").pack()
SHdata=StringVar()
SHdata.set(" separate country name")
entry= Entry(root, textvariable= SHdata , width = 100).pack()
Button(root, text=" DATA", command =data).pack()
root.mainloop()
OUTPUT ----
#python #programming #coding #java #javascript #programmer #snake #developer #html #machinelearning #code #coder #ballpython #pythonprogramming #computerscience #datascience #reptile #snakes #reptiles #snakesofinstagram #reptilesofinstagram #technology #php #css #linux #pythonsofinstagram #artificialintelligence #tech #webdeveloper
awesome article
ReplyDeleteNice application bro 👍
ReplyDelete