Professional Documents
Culture Documents
Covid 19
Covid 19
BHILAI
PROJECT ON
COMPUTER SCIENCE
This is to certify that the project is carried out by Edwin bara of Class
– XII – D of SRI SANKARA VIDYALAYA, SECTOR–X, BHILAI.
He has submitted the project during the academic year of 2023-24
towards the partial fulfillment of the requirement of the CBSE board
syllabus.
Signature of Principal
ACKNOWLEDGEMENT
I wish to express my deep gratitude and sincere thanks to the school Principal,
Mr. Bipin Deshmukh Sir for his encouragement who provided facilities for this school
project. I sincerely appreciate his generosity for taking me into his fold for which I shall
remain indebted to him. I extend my appreciation to Mrs L. Laxmi Prasad our subject
teacher who guided me to the successful completion of this project. I take this
encouragement, enormous motivation, which has sustained my efforts at all the stages
classmates who helped me to carry out this project successfully and for their valuable
Investigatory project is a very efficient method of learning by doing. It differs from the
lab practical where the procedures, practical results are fixed. During the preparation of
the project, I had to use research method to collect material from different sources to
I have tried my best to present all the aspects related with the subject topic and topic’s
information. However, I accept sole responsibility of any possible omission and will
# Ask for a State name, then run a query to extract actual stats through
# Python-SQL integration w/ GUI(Tkinter)
# Please enter database details at line 199 & 200 with other references in the
code.
def showTable():
# Fetching different columns.
cursor.execute('SELECT srno FROM stat;')
query1 = cursor.fetchall()
srno = []
for i in query1:
srno.append(i[0])
#Alert Window
alert = tkinter.Tk()
alert.title('Alert✅')
alert.geometry('310x90')
alert.configure(bg='white')
text = "Check the Python Console."
text1box = Text(alert,height=2,width=70, font=("Calibiri",10), borderwidth=0)
text1box.pack(expand=True)
text1box.insert('end', text)
text1box.config(state='disabled')
text1box.place(x = 70, y = 10)
alert.mainloop()
def showGraph():
# Query components, '%s' used to use python variables in the SQL query.
query_1 = "SELECT active_cases,cured,death,confirmed_cases FROM stat WHERE
state_ut = '%s';"
query_2 = state_name.get()
cursor.execute(query_1%(query_2))
query_result = cursor.fetchone()
result = list(query_result) #Converting to list for later assignment of the
same.
stats = result
# Graph Code
x_axis=['Active','Cured','Casualties','Confirmed Cases']
# Assigning the width and color.
plt.figure(figsize=(15,4))
plt.bar(x_axis,stats,width = 0.9, color = ['red', 'green','blue','violet'])
plt.xticks(rotation=0)
# naming the x-axis
plt.xlabel('CASES IN %s'%(state_name.get()))
# naming the y-axis
plt.ylabel('CASE STATS in Lakhs')
# plot title
plt.title('%s COVID-19 CASES *as on Aug 8, 2021'%
(state_name.get()))
plt.show()
def showPie():
pie_search = "SELECT cured,death,confirmed_cases,active_cases FROM stat WHERE
state_ut = '%s';"
key = state_name.get()
cursor.execute(pie_search%(key))
result = cursor.fetchone()
#Easter Egg
def easterEgg():
#Button Function Definition
def jk():
text_box = Text(eastegg,height=1,width=55, font=("Bahnschrift SemiLight
Condensed",18), bg='#e6ffff', borderwidth=0)
text_box.pack(expand=True, side=BOTTOM, anchor=SE)
text_box.insert('end', "PS : Alexa had nothing to do with this, we made this
app ourselves !")
text_box.config(state='disabled')
#Jokes
bundle = [
'Mother: "How Was School Today, Patrick?"\nPatrick: "It Was Really Great
Mum! Today We Made Explosives!"\nMother: "Ooh, They Do Very Fancy Stuff With You
These Days. And What Will You Do At School Tomorrow?"\nPatrick: "What School?"',
'A potato was interrogated by cops. After 3 hours of torture, it gave in
and said\n"Main batata hun, main batata hun"',
'Did you know that you can cool yourself to -273.15˚C and still be 0K !',
'Do not trust atoms,\nthey make up everything','Two chemists go into a
restaurant.\nThe first one says "I think I will have an H2O."\nThe second one
says "I think I will have an H2O too" -- and he died',
'Q: What did the scientist say when he found 2 isotopes of helium?\nA:
HeHe',
'Lata: Is it right to punish someone for something they have not done?\
nTeacher: Of course, not!\nLata: I have not done my homework.',
'"I hate audio correct."',
'Did you hear about the college professor who was involved in a terrible
car wreck?\nHe was grading papers on a curve',
'Never lend money to a friend.\nIt is dangerous. It could damage his
memory.',
'God: You are going to power cars in the future\nDinosaurs: Cool! We are
goin to drive!\nGod: Well no, you are going to be the fuel... ',
'Friends pay restaurant bills on a de-tu-de basis.',
'A photon checks into a hotel, where a bellhop asks where its suitcase is.\
nThe photon replies, "I didn't bring any luggage. I'm traveling light."']
eastegg = tkinter.Tk()
eastegg.title('Easter Egg')
eastegg.configure(bg = '#e6ffff')
eastegg.geometry('1330x480')
joke = tkinter.Button(eastegg, text="Alexa 😜, Tell Me a Joke!",height = 2,
width = 30, font=("Bahnschrift Condensed",16), bg='white', borderwidth=1, command
= jk)
joke.place(x=530,y=20)
eastegg.mainloop()
cursor = cases_DB.cursor()
# GUI Code
root = tkinter.Tk()
root.title('REAL TIME COVID 19 STATS ~DEVELOPED by OM ARYAN and AMIT SIROHI')
root.geometry('1280x720')
root.configure(bg = '#e6ffff')
# Taking Input
state_name = ttk.Combobox(root, values=name, font=("Calibiri",16))
state_name.place(x=440,y=200,width=310,height=55)
# Button Configurations
confirm = tkinter.Button(root, text="CONFIRM",height = 3, width = 20,
bg='white',borderwidth=1,command = conFirm)
confirm.place(x=750, y=200)
root.mainloop()
cases_DB.close() #Closing the SQL Connection