You are on page 1of 20

COMPUTER SCIENCE PROJECT

ACADEMIC YEAR
2021-2022

PROJECT ON PYTHON AND MYSQL

Name:
Sujal Shah
Rohan Asthana
Certificate

This is to certify that Sujal Shah of class XII Science, has successfully completed his Computer
science project on the topic entitled ‘Information System’.
The report is the result of his effort and endeavors. The report is found worthy of acceptance as the
final project report for the subject of Computer Science (083) of class XII under the CBSE curriculum
2021-22.

The report has been prepared under the guidance.

Nidhi Sharma Anjali Mahajan


Teacher Incharge Principal

Signature of External Examiner School stamp


ACKNOWLEDGEMENT

I would like to express a deep sense of thanks and gratitude to my guide Mrs. Nidhi Sharma,
for guiding me immensely through the course of the project. Her constructive advice and
constant motivation have been responsible for the successful completion of this project.
My sincere thanks go to Mrs. Anjali Mahajan, our principal ma’am, for her coordination in
extending every possible support and IT infrastructure for the completion of this project.
I also thanks my parents for there motivation and support. I must thank to my classmate for
their timely help and support.

Name: Sujal Shah Name: Rohan Asthana


Roll NO: 18 Roll No:13
12th science 12th science
General Overview Of the Problem

This project will basically benefit the people migrating to India. People who are new to this
country are most of the time misguided by the locals. Which makes the living of the migrants
difficult in this country. The migrants are unaware of the laws of these country as well as the
prices of basic goods which are necessary for living. They try to seek help from the local people
but not all help them. They are usually misguided by the people and they end up getting no solution
for their problem.
OBJECTIVE OF THE PROJECT

This project will basically help the migrants. In these we will create a program which will contain all
the information regarding the area where the migrant is residing. The program will contain list of few
cities such as Vadodara, Surat, Ahemdabad , Jamnagar ,Rajkot, Gandhinagar. If any migrant comes to
reside in any of these cities , we will provide basic services such as details of various hospitals in
which area is it present. Pharma stores which is very important for a migrant , all details will be
provided to the user. We will also provide details of various Hotels present at best rate for the user to
accommodate. The data will be provided area wise to the user for more easier convenience It will be
a easy to use program, you will need to enter name the place about which you want the information
and the user will get the details of the demanded services.
Project requirements

Hardware requirements:
● Laptop
● Processor - Intel Core i3, i5, i7
● 2,8,16 GB RAM

Software requirements:
● Operating system - Windows 10, 11
● IDLE Python 3.9 32, 64-bit or anaconda spider
● MySQL
● Visual studio
PYTHON:

Python is a popular programming language. It was created by Guido van Rossum, and released in
1991. Python is a very simple programming language so even if you are new to programming, you
can learn python without facing any issues.
Python is a programming language that lets you work quickly and integrate systems more efficiently.
It is used for web development, software development, calculations, etc.
Python works on different platforms (Windows, Mac, Linux, Raspberry, etc.)
Python has a simple syntax similar to the English language. Python has a syntax that allows
developers to write programs with fewer lines than some other programming languages. Python runs
on an interpreter system, meaning that code can be executed as soon as it is written

Feature of Python Programming Language:

● Readable: Python is a very readable language.


● Easy to Learn: Learning python is easy as this is an expressive and high-level programming
language, which means it is easy to understand the language and thus easy to learn.

● Cross-platform: Python is available and can run on various operating systems such as Mac,
Windows, Linux, Unix, etc. This makes it a cross-platform and portable language.

● Open Source: Python is an open-source programming language.


MYSQL:

MySQL is an open-source relational database management system


(RDBMS).
Its name is a combination of "My", the name of co-founder Michael Widenius's daughter, and "SQL",
the abbreviation for Structured Query Language. A relational database organizes data into one or
more data tables in which data types may be related to each other; these relations help structure the
data. SQL is a language programmers use to create, modify and extract data from the relational
database, as well as control user access to the database.
MySQL is free and open-source software under the terms of the GNU General Public License.
MySQL was owned and sponsored by the Swedish company MySQL AB, which was bought by Sun
Microsystems (now Oracle Corporation).

Feature of MySQL:

● Easy to use: MySQL is easy to use. We have to get only the basic knowledge of SQL. We can build
and interact with MySQL by using only a few simple SQL statements.

● Dual Password Support: MySQL version 8.0 provides support for dual passwords: one is the current
password, and another is a secondary password, which allows us to transition to the new
password.

● Free to download: MySQL is free to use so that we can download it from MySQL’s official website
without any cost.

● Speed: MySQL is considered one of the very fast database languages, backed by a large number of
benchmark tests.

● High Flexibility: MySQL supports a large number of embedded applications, which makes MySQL
very flexible.

● Memory efficiency: Its efficiency is high because it has a very low memory leakage problem.
● High Performance: MySQL is faster, more reliable, and cheaper because of its unique storage
engine architecture. It provides very high performance results in comparison to other databases
without losing an essential functionality of the software.

● GUI Support: MySQL provides a unified visual database graphical user interface tool named
"MySQL Workbench" to work with database architects, developers, and Database Administrators.
MySQL has full GUI support from MySQL Server version 5.6 and higher.
REQUIREMENT ANALYSIS:-

To access our app , the user need to have a laptop having either windows 10 or 11 and intel core
processor i3,i5,i7. The user needs to have 2 GB , 8 Gb ,16 GB RAM for execution of our app. The
software requirements are idle python which can be 32 bit or 64 bit. We have used Mysql for creating
a database of our program. We require a table displaying information about the pharma stores of all
the cities which includes Vadodara, Surat , Ahemdabad , Gandhinagar ,Rajkot , Jamnagar along with
their areas. We also require a table for hospitals of all the cities and their areas in which they are
located. We also require a table for all the hotels available at best rates along with their areas. The
most requirement is the STD code of the city. We have connected this table with python using a
connector. To create the interface we have used tkinter as the tool.
Feasibility

Our project is a very feasible one and is very easy to make the app. It just requires some basic
knowledge about mysql and python. We required almost 10 hours to complete the entire
project which included few research work , preparation of tables of pharma stores ,hospitals
and hotels. We also completed linking it with python and preparing the interface of the
project with necessary modifications to it. Our project is technologically feasible too as it
requires some basic softwares such as mysql , python and visul studios. Overall our project is
a feasible one.
Python code

import tkinter as tk
import mysql.connector
import PIL

connection = mysql.connector.connect(
host="localhost",
user="root",
password="2511",
)

cursor = connection.cursor(buffered=True)
cursor.execute("use computer_project")
#rec = cursor.fetchall()
photo = "logo.png"

def back(current,main):
main.deiconify()
current.destroy()

def getv(main,city,region,ser,cursor):
l = tk.StringVar()
lt = l.get()
main.withdraw()
tp = tk.Toplevel(main)
tp.geometry("870x700")
tp.configure(bg = "#DE6660")
p = tk.Label(tp, image = photo)
p.pack()
e = tk.Label(tp,text = lt,bg = "#3EE2FF")
e.pack()
cityl = [city]
regionsl = []
cursor.execute("SELECT distinct region FROM hospitals where city = %s",cityl)
regions = cursor.fetchall()

for i in regions:
regionsl.append("".join(map(str, i)))
for i in regionsl:
if i == region:
il = [i]
if ser =="Hospitals":
query = "SELECT * FROM hospitals where region = %s"
cursor.execute(query,il)
o = cursor.fetchall()
for u in o:
lt = lt + str(u) + "\n"
e.config(text = lt)

elif ser =="Pharma Stores":


print('this is selected')
query = "SELECT * FROM Pharma_stores where region = %s"
cursor.execute(query,il)
o = cursor.fetchall()
for u in o:
lt = lt + str(u) + "\n"
e.config(text = lt)

elif ser =="Hotels":

query = "SELECT * FROM hotels where region = %s"


cursor.execute(query,il)
o = cursor.fetchall()
for u in o:
lt = lt + str(u) + "\n"
e.config(text = lt)

back_button = tk.Button(tp, text="Home",bg = "#3EE2FF", command= lambda : back(tp,main))


back_button.pack()
tp.title("Values Window")
tp.mainloop()

root1 = tk.Tk()
Sn=()

img = PIL.Image.open(photo)
img = img.resize((300, 200), PIL.Image.ANTIALIAS)
photo = PIL.ImageTk.PhotoImage(img)

x = 875
y = 700
root1.geometry(str(x) + "x" + str(y))

p = tk.Label(root1, image = photo)


p.grid(row = 11,column=2,sticky='NSEW')

root1.c = 0.467
root1.configure(bg = "#DE6660")

m = tk.Label(root1,text='WELCOME TO CITY TOUR',font = (20),bg = "#DE6660")


m.grid(row = 30,column=2,sticky='NSEW')

el1 = tk.Label(root1,width=20,bg = "#DE6660")


el1.grid(row = 10,column=0,sticky='NSEW')
el2 = tk.Label(root1,width=20,bg = "#DE6660")
el2.grid(row = 10,column=1,sticky='NSEW')
el1 = tk.Label(root1,width=20,bg = "#DE6660")
el1.grid(row = 20,column=0,sticky='NSEW')
el1 = tk.Label(root1,width=20,bg = "#DE6660")
el1.grid(row = 40,column=1,sticky='NSEW')
el2 = tk.Label(root1,width=20,bg = "#DE6660")
el2.grid(row = 180,column=1,sticky='NSEW')
el2 = tk.Label(root1,width=20,bg = "#DE6660")
el2.grid(row = 91,column=1,sticky='NSEW')
el2 = tk.Label(root1,width=20,bg = "#DE6660")
el2.grid(row = 131,column=1,sticky='NSEW')
ts=""
hs=""
ys=""
var = tk.StringVar(root1)

opt3=[""]
def show():
global ts
t.config(text = clicked.get())
ts = clicked.get()
refresh()

def refresh():
var.set('')
global opt3
drop2['menu'].delete(0, 'end')

if ts == "Ahmedabad":
opt3=("sabarmati","Bhadra","CG Road")

elif ts == "Surat":
opt3=("Haripura","Shahpar","Karanj")

elif ts == "Vadodara":
opt3= ("vasna","alkapuri","Akota")

elif ts == "Rajkot":
opt3 =("ajitpura","vasna","abu road")

elif ts == "Jamnagar":
opt3 =("Patel colony","Indra Gandhi road","Digjam circle")

elif ts == "Gandhinagar":
opt3 =("Kudasan","Raysan","vavol")

for choice in opt3:


drop2['menu'].add_command(label=choice, command=tk._setit(clicked2, choice))

def show1():
h.config(text = clicked1.get())
global hs
hs=clicked1.get()

def show2():
y.config(text = clicked2.get())
global ys
ys=clicked2.get()

options = [
"Ahmedabad",
"Surat",
"Vadodara",
"Rajkot",
"Jamnagar",
"Gandhinagar"]

options1 = ["Hospitals",
"Pharma Stores",
"Hotels"]

b = tk.Label(root1,bg = "#3EE2FF",text = "Select the City-",width=20)


b.grid(row = 60,column=1,sticky='NSEW')

x = tk.Label(root1,bg = "#3EE2FF",text = "Select the Region-",width=20)


x.grid(row = 100,column=1,sticky='NSEW')

d = tk.Label(root1,bg = "#3EE2FF",text = "Select the Services-",width=20)


d.grid(row = 140,column=1,sticky='NSEW')

t = tk.Label(root1,text=ts,bg = "#3EE2FF")
t.grid(row = 90,column=2,sticky='NSEW')
t.config(text = ts)

h = tk.Label(root1,text=hs,bg = "#3EE2FF")
h.grid(row = 170,column=2,sticky='NSEW')
h.config(text = hs)

y = tk.Label(root1,text=ys,bg = "#3EE2FF")
y.grid(row = 130,column=2,sticky='NSEW')
y.config(text = ys)

clicked=tk.StringVar(root1)
clicked.set( "Ahmedabad" )

clicked1=tk.StringVar(root1)
clicked1.set( "Hospitals" )

clicked2=tk.StringVar(root1)
clicked2.set( "Region" )

drop = tk.OptionMenu( root1 , clicked , *options,command = refresh )


drop.grid(row = 70,column=2,sticky='NSEW')
drop.config(bg = "#3EE2FF")
drop["menu"].config(bg="#3EE2FF")

drop1 = tk.OptionMenu( root1 , clicked1 , *options1 )


drop1.grid(row = 150,column=2,sticky='NSEW')
drop1.config(bg = "#3EE2FF")
drop1["menu"].config(bg="#3EE2FF")

drop2 = tk.OptionMenu( root1 , clicked2 , *opt3 )


drop2.grid(row = 110,column=2,sticky='NSEW')
drop2.config(bg = "#3EE2FF")
drop2["menu"].config(bg="#3EE2FF")

button = tk.Button( root1 ,bg = "#3EE2FF", text = "Submit City" , command = show)
button.grid(row = 80,column=2,sticky='NSEW')

button1 = tk.Button( root1 ,bg = "#3EE2FF", text = "Submit Service", command = show1 )
button1.grid(row = 160,column=2,sticky='NSEW')

button3 = tk.Button( root1 ,bg = "#3EE2FF", text = "Submit Region" , command = show2 )
button3.grid(row = 120,column=2,sticky='NSEW')

button2 = tk.Button( root1 ,bg = "#3EE2FF", text = "Get values" , command = lambda:
getv(root1,ts,ys,hs,cursor))
button2.grid(row = 200,column=2,sticky='NSEW')

root1.title("Home")

root1.mainloop()

Python Image code


import tkinter as tk

from PIL import Image, ImageTk


mahmudul_root = tk.Tk()
mahmudul_root.geometry("1255x944")
image = Image.open("logo.png")
photo = ImageTk.PhotoImage(image)
varun_label = tk.Label(image=photo)
varun_label.place(x=150, y=70)

mahmudul_root.mainloop()

Output screen
System Specification

These program is compatible with i5, i7, i3 and system type 64-bit operating system, x64-based processor
and 32-bit operating system, x32-based processor. 11th Gen Intel and Windows 11.

 Compatible with Android devices that have 2GB RAM or more and have Android Version 6.0–10.0+
installed.
Bibliography

1} NCERT Textbook Sumita Arora.


2}AP
3}https://www.geeksforgeeks.org/
4}https://www.w3schools.com/sql/

You might also like