You are on page 1of 68

SIVAGIRI VIDYANKETAN, ALUVA

A PROJECT REPORT
ON
STUDENT MANAGEMENT

COMPUTER SCIENCE
SESSION: 2020 – 2021

SIVAGIRI VIDYANIKETAN
SENIOR SECONDARY SCHOOL
VALMIKI HILLS
THOTTUMUGHOM – ALUVA 683105

COMPUTER SCIENCE-083
SIVAGIRI VIDYANKETAN, ALUVA

SIVAGIRI VIDYANIKETAN
SENIOR SECONDARY SCHOOL
VALMIKI HILLS
THOTTUMUGHOM - ALUVA 683105

COMPUTER SCIENCE
PROJECT REPORT
ON
STUDENT MANAGEMENT
SESSION: 2020-2021

SUBMITTED TO & BY:


Ms. MONISHA MOHANAN JEEVAN G KRISHNAN
DEPT. OF COMPUTER SCIENCE REG NO.:
CLASS XII A

COMPUTER SCIENCE-083
SIVAGIRI VIDYANKETAN, ALUVA

SIVAGIRI VIDYANIKETAN
SENIOR SECONDARY SCHOOL
VALMIKI HILLS
THOTTUMUGHOM – ALUVA 683105

CERTIFICATE

Certified that this is the bona-fide record of project work in Computer Science by
Jeevan G Krishnan, Reg No.: …………………………. submitted for AISSCE Practical
Examination 2019-2020 at Sivagiri Vidyaniketan Senior Secondary School, Aluva.

Principal

Teacher In-Charge External Examiner

Date:
Thottumughom

COMPUTER SCIENCE-083
SIVAGIRI VIDYANKETAN, ALUVA

ACKNOWLEDGEMENT

We are grateful to almighty for giving us the strength to successfully conduct out experiment
and for sustaining our efforts. We very proudly render our grateful thanks to our resident
manager, Mr. SALIMKUMAR and our Principal, Mr. SURESH M. VELAYUDHAN for
giving us an opportunity to do this project & also for providing the facilities to complete it. We
express our sincere gratitude to our computer science teacher, Mrs. MONISHA MOHANAN,
for her endless support, encouragement and sincere guidance for the fulfillment of our project.
We proudly render our thanks to our class teacher, Mrs. STEJU PRAMOD, for her
encouragement and support.

We wish to acknowledge our cordial thanks and deep sense of gratitude to our parents and
guardians, to the authors and publishers of the books and the managements of the websites we
referred to (as in Bibliography) and various individuals who helped directly or indirectly in
completing this project successfully.

JEEVAN G KRISHNAN

COMPUTER SCIENCE-083
SIVAGIRI VIDYANKETAN, ALUVA

INDEX

SL. PAGE
TOPIC
NO. NO.
1. INTRODUCTION 1
2. SYSTEM ANALYSIS 2
3. AIM 3
4. PYTHON 4
5. MySQL 5
6. TKINTER 6
7. MODULES 7
8. TABLES GENERATED 8
9. SOURCE CODE 9
10. SCREENCASTS 47
11. SCOPE OF THE PROJECT 60
12. BIBLIOGRAPHY 61

COMPUTER SCIENCE-083
SIVAGIRI VIDYANKETAN, ALUVA

INTRODUCTION

The Student Management system integrated with the database introduces its clients to a whole
another level of management with its highly specific and easy-to-use functions.
This project has been developed with the aim of providing a user-friendly experience strictly
for educational institutions for the betterment of quality of education.
By using this application, it provides a platform where the clients can:

• Add students details


• Update student details
• Delete student details
• And even View student details

That’s not all. The clients can even view the staff details which is non editable by other staffs
thus providing another security but that is only beta tested.
The main overview of the project is to provide its clients a computerized application which
could access and could easily alter their data with ease and much efficiency.

COMPUTER SCIENCE-083 Page | 1


SIVAGIRI VIDYANKETAN, ALUVA

SYSTEM ANALYSIS

EXISTING SYSTEM
The existing system for student management would be the old-fashioned pen and paper which
is still being used in many institutions still. And old systematic programs are still being used
where data loss and security breaches have become common.
The institution manager or the client may not have the time for going through every single page
to find the record of one single student, or have the storage to store the records of all the students
who studied in their own respective institutions.

PROPOSED SYSTEM
This project mainly aimed in providing premium services to educational institutions with an
aim of better management of students, as well as staff, all across the state.
As we all know, better management leads to betterment of the clients using it by numerous
factors: -

• Less storage of files


• Less tension and stress for clients
• Faster accessing of data
• Low cost

Such a system of pen and paper would result in the building up of tension and stress as well as
high cost for storing it since it would require lots of storage
Thus, The Student Management System with a proper database would be a suitable
replacement which provides services like Adding New Student Details, Updating Existing
details, Deleting as well as Displaying the Student Details.

COMPUTER SCIENCE-083 Page | 2


SIVAGIRI VIDYANKETAN, ALUVA

AIM

This project has been aimed at providing its clients an high-end application where it provides
a platform where they can the following functions for their data:

• Adding students details


• Updating student details
• Deleting student details
• And Viewing student details

COMPUTER SCIENCE-083 Page | 3


SIVAGIRI VIDYANKETAN, ALUVA

PYTHON

Python is an interpreted, high-level, general-purpose programming language. Created by Guido


van Rossum and first released in 1991, Python's design philosophy emphasizes code readability
with its notable use of significant whitespace. Its language constructs and object-oriented
approach aim to help programmers write clear, logical code for small and large-scale projects.

Python is dynamically typed and garbage-collected. It supports multiple programming


paradigms, including procedural, object-oriented, and functional programming. Python is often
described as a "batteries included" language due to its comprehensive standard library.

Python was conceived in the late 1980s as a successor to the ABC language. Python 2.0,
released in 2000, introduced features like list comprehensions and a garbage collection system
capable of collecting reference cycles. Python 3.0, released in 2008, was a major revision of
the language that is not completely backward-compatible, and much Python 2 code does not
run unmodified on Python 3. Due to concern about the amount of code written for Python 2,
support for Python 2.7 (the last release in the 2.x series) was extended to 2020. Language
developer Guido van Rossum shouldered sole responsibility for the project until July 2018 but
now shares his leadership as a member of a five-person steering council.

The Python 2 language, i.e. Python 2.7.x, is "sunsetting" on January 1, 2020, and the Python
team of volunteers will not fix security issues or improve it in other ways after that date. With
the end-of-life, only Python 3.5.x and later will be supported.

Python interpreters are available for many operating systems. A global community of
programmers develops and maintains CPython, an open source reference implementation. A
non-profit organization, the Python Software Foundation, manages and directs resources for
Python and CPython development.

COMPUTER SCIENCE-083 Page | 4


SIVAGIRI VIDYANKETAN, ALUVA

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.

MySQL is free and open-source software under the terms of the GNU General Public License,
and is also available under a variety of proprietary licenses. MySQL was owned and sponsored
by the Swedish company MySQL AB, which was bought by Sun microsystems (now Oracle
Corporation). In 2010, when Oracle acquired Sun, Widenius forked the open-source MySQL
project to create MariaDB.

MySQL is a component of the LAMP web application software stack (and others), which is an
acronym for Linux, Apache, MySQL, Perl/PHP/Python. MySQL is used by many database-
driven web applications, including Drupal, Joomla, phpBB, and WordPress. MySQL is also
used by many popular websites, including Facebook, Flickr, MediaWiki, Twitter, and
YouTube.

COMPUTER SCIENCE-083 Page | 5


SIVAGIRI VIDYANKETAN, ALUVA

TkInter

TkInter is a Python binding to the Tk GUI toolkit. It is the standard Python interface to the Tk
GUI toolkit, and is Python's de facto standard GUI. Tkinter is included with standard Linux,
Microsoft Windows and Mac OS X installs of Python.

The name Tkinter comes from Tk interface. Tkinter was written by Fredrik Lundh. Tkinter is
free software released under a Python license.

As with most other modern Tk bindings, Tkinter is implemented as a Python wrapper around
a complete TCL interpreter embedded in the Python interpreter. Tkinter calls are translated into
TCL commands which are fed to this embedded interpreter, thus making it possible to mix
Python and TCL in a single application.

The "themed Tk" ("ttk") functionality of Tk 8.5 allows Tk widgets to be easily themed to look
like the native desktop environment in which the application is running, thereby addressing a
long-standing criticism of Tk (and hence of Tkinter).

COMPUTER SCIENCE-083 Page | 6


SIVAGIRI VIDYANKETAN, ALUVA

MODULES
• Tkinter (tkinter)
• MySQL-Connector (myql.connector)
• Pillow (pil)
• Tkinter Calendar (tkcalendar)
• Datetime (datetime)

COMPUTER SCIENCE-083 Page | 7


SIVAGIRI VIDYANKETAN, ALUVA

TABLES GENEREATED
Before Execution:

After Execution:

COMPUTER SCIENCE-083 Page | 8


SIVAGIRI VIDYANKETAN, ALUVA

SOURCE CODE
from tkinter import *
import tkinter as tk
import tkinter.font as font
from tkinter.ttk import *
import tkinter.scrolledtext as scroll
from tkinter import messagebox
from PIL import ImageTk,Image
import mysql.connector as sql
from mysql.connector import Error
from tkinter import Menu
from tkcalendar import Calendar, DateEntry
from datetime import date

def search_upd():
global txt_admno4,upd_studentwindow,root,txt_admno3
admno=txt_admno4.get()
try:

connection=sql.connect(host="localhost",user="root",passwd="root",database="
project")
cursor=connection.cursor()
cursor.execute("select * from student where admno='{}'".format(admno))
data=cursor.fetchall()
#line1='Adm.no Name DOB Class '

#label1=Label(upd_studentwindow,text=line1,width=28,font=("bold",17)).plac
e(x=430,y=335)

COMPUTER SCIENCE-083 Page | 9


SIVAGIRI VIDYANKETAN, ALUVA

j=0
for i in data:

label=Label(upd_studentwindow,text=i,width=32+int(len(i)),font=("bold",12+l
en(i))).place(x=430,y=360)
j+=20

myFont=font.Font(family='Helvetica', size=20, weight='bold')

s=upd_studentwindow
except EOFError as e:
messagebox.showinfo('Not success',e)

def update_upd():
global
txt_admno3,txt_admno4,txt_name,txt,n,class_choosen,value,upd_studentwindo
w,root
admno3=txt_admno3.get()
admno4=txt_admno4.get()
name=txt_name.get()
dob=txt.get()
clas=n.get()
if value==1:
gender='male'
if value==2:
gender='female'
try:

COMPUTER SCIENCE-083 Page | 10


SIVAGIRI VIDYANKETAN, ALUVA

connection=sql.connect(host="localhost",user="root",passwd="root",database="
project")
cursor=connection.cursor()
cursor.execute("UPDATE STUDENT SET
admno='{}',name='{}',dob='{}',class='{}',gender='{}' where
admno='{}'".format(admno3,name,dob,clas,gender,admno4))
connection.commit()
messagebox.showinfo('Details added ','Details saved successfully')
s=upd_studentwindow
s.destroy()
homepage()
except EOFError as e:
messagebox.showinfo('Not success',e)

def Date_Entry_upd():
'''To show calendar & to select a date o journey'''
global homewindow,txt,date1,upd_studentwindow,txt_admno3
txt.config(state="Disabled")
txt.delete(0,END)
x=str(date.today())
y=x.split('-')
yy=int(y[0])
mm=int(y[1])
dd=int(y[2])

COMPUTER SCIENCE-083 Page | 11


SIVAGIRI VIDYANKETAN, ALUVA

top=Toplevel(upd_studentwindow)
def print_sel():
global date1
date=cal.selection_get()
date1=str(date)
txt.insert(0,date)
txt.config(state="disabled")
top.destroy()
cal=Calendar(top,font="Arial 14", selectmode='day',cursor="hand1",
year=yy, month=mm,day=dd)
cal.pack(fill="both", expand=True)
Button(top, text="Ok", command=print_sel).pack()

def upd_student():
global
root,homewindow,txt_admno4,txt_admno3,upd_studentwindow,dob,Date_Entr
y,txt,v1,txt_name,n
s=homewindow
s.destroy()
class Window(Frame):
def __init__(self,master=None):
Frame.__init__(self,master)
self.master=master
self.pack(fill=BOTH,expand=1)
load=Image.open("Updatestu.jpg")

COMPUTER SCIENCE-083 Page | 12


SIVAGIRI VIDYANKETAN, ALUVA

render=ImageTk.PhotoImage(load)
img=Label(self,image=render)
img.image=render
img.place(x=0,y=0)
upd_studentwindow=Tk()
add=Window(upd_studentwindow)

x=int(((upd_studentwindow.winfo_screenwidth())/2)-510)
y=int(((upd_studentwindow.winfo_screenheight())/2)-383)
upd_studentwindow.geometry('1020x766+{}+{}'.format(x,y))
upd_studentwindow.title("Student form")

v1=IntVar(upd_studentwindow,1)
label1=Label(upd_studentwindow,text="Admission
Number",width=20,font=("bold",15))
label1.place(x=430,y=275)
label2=Label(upd_studentwindow,text=' New
values',width=20,font=("bold",15))
label2.place(x=390,y=430)
label3=Label(upd_studentwindow,text="Admission
Number",width=15,font=("bond",15))
label3.place(x=120,y=470)
label4=Label(upd_studentwindow,text=' Name',width=10,font=("bold",15))
label4.place(x=340,y=470)

Button(upd_studentwindow,text='DOB',width=6,command=Date_Entry_upd).p
lace(x=530,y=470)
label5=Label(upd_studentwindow,text="
Class",width=11,font=("bold",15))

COMPUTER SCIENCE-083 Page | 13


SIVAGIRI VIDYANKETAN, ALUVA

label5.place(x=640,y=470)
label6=Label(upd_studentwindow,text="
Gender",width=11,font=("bold",15))
label6.place(x=820,y=470)

txt_admno4=Entry(upd_studentwindow)
txt_admno4.place(x=670,y=275)
txt_admno3=Entry(upd_studentwindow)
txt_admno3.place(x=140,y=500)
txt_name=Entry(upd_studentwindow)
txt_name.place(x=333,y=500)

n=StringVar()
class_choosen=Combobox(upd_studentwindow,width=27,textvariable = n)
# Adding combobox drop down list
class_choosen['values'] = ('Select class','I','II','III','IV','V','VI'
,'VII','VIII','IX','X','XI','XII')
class_choosen.place(x=630,y=500)
# Shows 'select class' as a default value
class_choosen.current(0)

radioB1=Radiobutton(upd_studentwindow,text='Male',width=6,value=1,variabl
e=v1,command=male_click)
radioB1.place(x=820,y=500)

radioB2=Radiobutton(upd_studentwindow,text='Female',width=7,value=2,varia
ble=v1,command=female_click)
radioB2.place(x=870,y=500)

COMPUTER SCIENCE-083 Page | 14


SIVAGIRI VIDYANKETAN, ALUVA

txt=Entry(upd_studentwindow)
txt.place(x=490,y=500)
txt.insert(0, " *select DOB*")
txt.config(state="Disabled")

Button(upd_studentwindow,text="Enter",width=10,command=search_upd).plac
e(x=430,y=300)

Button(upd_studentwindow,text='Back',width=6,command=update_back).place
(x=410,y=570)

Button(upd_studentwindow,text='Save',width=10,command=update_upd).place
(x=490,y=570)
Button(upd_studentwindow,text='Clear
All',width=10,command=update_clear).place(x=580,y=570)

def update_back():
global upd_studentwindow
s= upd_studentwindow
s.destroy()
homepage()
def update_clear():
global
txt_admno,txt_name,txt,n,class_choosen,value,upd_studentwindow,root
txt_admno3.delete(0,END)
txt_admno4.delete(0,END)

COMPUTER SCIENCE-083 Page | 15


SIVAGIRI VIDYANKETAN, ALUVA

txt_name.delete(0,END)
txt.delete(0,END)
class_choosen.current(0)

##############################################

def search_del():
global txt_admno,del_studentwindow,root
admno=txt_admno.get()
try:

connection=sql.connect(host="localhost",user="root",passwd="root",database="
project")
cursor=connection.cursor()
cursor.execute("select * from student where admno='{}'".format(admno))
data=cursor.fetchall()
j=0
for i in data:

label=Label(del_studentwindow,text=i,width=38+len(i),font=("bold",20)).place
(x=270,y=400)
j+=20

myFont=font.Font(family='Helvetica', size=20, weight='bold')

COMPUTER SCIENCE-083 Page | 16


SIVAGIRI VIDYANKETAN, ALUVA

Button(del_studentwindow,text="proceed",width=10,command=delete_del).pla
ce(x=370,y=460)
s=del_studentwindow
except EOFError as e:
messagebox.showinfo('Not success',e)

def delete_del():

global
txt_admno,del_studentwindow,root,txt_name,txt,n,class_choosen,value
admno=txt_admno.get()
try:

connection=sql.connect(host="localhost",user="root",passwd="root",database="
project")
cursor=connection.cursor()
cursor.execute("delete from student where admno='{}'".format(admno))
connection.commit()
messagebox.showinfo("Warning","Data deleted successfully")
s=del_studentwindow
s.destroy()
homepage()
except EOFError as e:
messagebox.showinfo('Not success',e)

def del_student():

COMPUTER SCIENCE-083 Page | 17


SIVAGIRI VIDYANKETAN, ALUVA

global root,homewindow,txt_admno,del_studentwindow
s=homewindow
s.destroy()
class Window(Frame):
def __init__(self,master=None):
Frame.__init__(self,master)
self.master=master
self.pack(fill=BOTH,expand=1)
load=Image.open("delstu.png")
render=ImageTk.PhotoImage(load)
img=Label(self,image=render)
img.image=render
img.place(x=0,y=0)
del_studentwindow=Tk()
add=Window(del_studentwindow)
x=int(((del_studentwindow.winfo_screenwidth())/2)-510)
y=int(((del_studentwindow.winfo_screenheight())/2)-382)
del_studentwindow.geometry('1020x764+{}+{}'.format(x,y))
del_studentwindow.title("Student form")

label1=Label(del_studentwindow,text="Admission
Number",width=20,font=("bold",15))
label1.place(x=370,y=320)
txt_admno=Entry(del_studentwindow)
txt_admno.place(x=620,y=320)

COMPUTER SCIENCE-083 Page | 18


SIVAGIRI VIDYANKETAN, ALUVA

Button(del_studentwindow,text="Enter",width=10,command=search_del,).plac
e(x=370,y=360)

Button(del_studentwindow,text='Back',width=6,command=delete_back).place(
x=410,y=570)
Button(del_studentwindow,text='Clear
All',width=10,command=delete_clear).place(x=580,y=570)

def delete_back():
global del_studentwindow
s= del_studentwindow
s.destroy()
homepage()
def delete_clear():
global
txt_admno,txt_name,txt,n,class_choosen,value,del_studentwindow,root
txt_admno.delete(0,END)

##############################################

def insert_back():
global add_studentwindow
s= add_studentwindow
s.destroy()

COMPUTER SCIENCE-083 Page | 19


SIVAGIRI VIDYANKETAN, ALUVA

homepage()
def insert_clear():
global
txt_admno,txt_name,txt,n,class_choosen,value,add_studentwindow,root
txt_admno.delete(0,END)
txt_name.delete(0,END)
txt.delete(0,END)
class_choosen.current(0)

def add_student():
global
root,homewindow,add_studentwindow,txt,txt_admno,txt_name,n,value,class_ch
oosen
s=homewindow
s.destroy()
class Window(Frame):
def __init__(self,master=None):
Frame.__init__(self,master)
self.master=master
self.pack(fill=BOTH,expand=1)
load=Image.open("addstu.png")
render=ImageTk.PhotoImage(load)
img=Label(self,image=render)
img.image=render
img.place(x=0,y=0)

COMPUTER SCIENCE-083 Page | 20


SIVAGIRI VIDYANKETAN, ALUVA

add_studentwindow=Tk()
add=Window(add_studentwindow)
x=int(((add_studentwindow.winfo_screenwidth())/2)-538)
y=int(((add_studentwindow.winfo_screenheight())/2)-355)
add_studentwindow.geometry('1077x711+{}+{}'.format(x,y))
add_studentwindow.title("Student Form")

v1=IntVar(add_studentwindow,1)
label1=Label(add_studentwindow,text="Enter Student
Details",width=20,font=("bold",10))
label1.place(x=460,y=360)

label2=Label(add_studentwindow,text="Admission
number",width=20,font=("bold",10))
label2.place(x=390,y=410)
txt_admno=Entry(add_studentwindow)
txt_admno.place(x=540,y=410)

label3=Label(add_studentwindow,text="Name",width=20,font=("bold",10))
label3.place(x=390,y=440)
txt_name=Entry(add_studentwindow)
txt_name.place(x=540,y=440)

Button(add_studentwindow,text='DOB',width=6,command=Date_Entry).place(
x=390,y=470)
txt=Entry(add_studentwindow)
txt.place(x=540,y=470)

COMPUTER SCIENCE-083 Page | 21


SIVAGIRI VIDYANKETAN, ALUVA

txt.config(state="Disabled")

label5=Label(add_studentwindow,text="Class",width=20,font=("bold",10))
label5.place(x=390,y=500)
n=StringVar()
class_choosen=Combobox(add_studentwindow,width=27,textvariable = n)
# Adding combobox drop down list
class_choosen['values'] = ('Select class','I','II','III','IV','V','VI'
,'VII','VIII','IX','X','XI','XII')
class_choosen.place(x=540,y=500)
# Shows 'select class' as a default value
class_choosen.current(0)

label6=Label(add_studentwindow,text="Gender",width=20,font=("bold",10))
label6.place(x=390,y=530)

radioB1=Radiobutton(add_studentwindow,text='Male',width=6,value=1,variabl
e=v1,command=male_click)
radioB1.place(x=540,y=530)

radioB2=Radiobutton(add_studentwindow,text='Female',width=7,value=2,varia
ble=v1,command=female_click)
radioB2.place(x=590,y=530)

Button(add_studentwindow,text='Back',width=6,command=insert_back).place(
x=410,y=570)

COMPUTER SCIENCE-083 Page | 22


SIVAGIRI VIDYANKETAN, ALUVA

Button(add_studentwindow,text='Save',width=10,command=insert_student).pla
ce(x=490,y=570)
Button(add_studentwindow,text='Clear
All',width=10,command=insert_clear).place(x=580,y=570)

add_studentwindow.mainloop()
def insert_student():
global
txt_admno,txt_name,txt,n,class_choosen,value,add_studentwindow,root
admno=txt_admno.get()
name=txt_name.get()
dob=txt.get()
clas=n.get()
if value==1:
gender='male'
if value==2:
gender='female'
try:

connection=sql.connect(host="localhost",user="root",passwd="root",database="
project")
cursor=connection.cursor()
cursor.execute("INSERT INTO STUDENT
VALUES({},'{}','{}','{}','{}')".format(admno,name,dob,clas,gender))
connection.commit()
messagebox.showinfo('Details added ','Details saved successfully')
s=add_studentwindow
s.destroy()
homepage()

COMPUTER SCIENCE-083 Page | 23


SIVAGIRI VIDYANKETAN, ALUVA

except EOFError as e:
messagebox.showinfo('Not success',e)
def Date_Entry():
'''To show calendar & to select a date o journey'''
global homewindow,txt,date1
txt.config(state="Disabled")
txt.delete(0,END)
x=str(date.today())
y=x.split('-')
yy=int(y[0])
mm=int(y[1])
dd=int(y[2])
top=Toplevel(add_studentwindow)
def print_sel():
global date1
date=cal.selection_get()
date1=str(date)
txt.insert(0,date)
txt.config(state="disabled")
top.destroy()
cal=Calendar(top,font="Arial 14", selectmode='day',cursor="hand1",
year=yy, month=mm,day=dd)
cal.pack(fill="both", expand=True)
Button(top, text="Ok", command=print_sel).pack()
def male_click():
global value
value=1
def female_click():

COMPUTER SCIENCE-083 Page | 24


SIVAGIRI VIDYANKETAN, ALUVA

global value
value=2

#############################################################
def teacher_back():
global teach
s= teach
s.destroy()

def teacher_details():
global teach
teach=Tk()
x=int(((teach.winfo_screenwidth())/2)-410)
y=int(((teach.winfo_screenheight())/2)-125)
teach.geometry("825x250+{}+{}".format(x,y))
teach.title('Staff Details')

text=scroll.ScrolledText(teach,width=100,height=450)
text.place(x=0,y=0)
text.insert(tk.INSERT,'\tAdmno\t\tName\t\tSubject\t\t\tAge\t\tGender\n')

connection=sql.connect(host="localhost",user="root",
passwd="root",database="project")
cursor=connection.cursor()
####### end of connection ####
cursor.execute("select * from teacher")
data=cursor.fetchall()
if data==' ':

COMPUTER SCIENCE-083 Page | 25


SIVAGIRI VIDYANKETAN, ALUVA

messagebox.showinfo('Exception','Empty table!')
else:
for i in data:
text.insert(tk.INSERT,'\t')
text.insert(tk.INSERT,str(i[0]))
text.insert(tk.INSERT,'\t\t')
text.insert(tk.INSERT,i[1])
text.insert(tk.INSERT,'\t\t')
text.insert(tk.INSERT,i[2])
text.insert(tk.INSERT,'\t\t\t')
text.insert(tk.INSERT,str(i[3]))
text.insert(tk.INSERT,'\t\t')
text.insert(tk.INSERT,i[4])
text.insert(tk.INSERT,'\n')
text.configure(state='disabled')
connection.close()
teach.mainloop()

#############################################################
def showstu_back():
global stush_window,homepage
s=stush_window
s.destroy()
homepage()

def print_student():
student1=Tk()

COMPUTER SCIENCE-083 Page | 26


SIVAGIRI VIDYANKETAN, ALUVA

x=int(((student1.winfo_screenwidth())/2)-410)
y=int(((student1.winfo_screenheight())/2)-125)
student1.geometry("825x250+{}+{}".format(x,y))
student1.title('Student Details')

text=scroll.ScrolledText(student1,width=100,height=450)
text.place(x=0,y=0)
text.insert(tk.INSERT,'\tAdmno\t\tName\t\t\tDOB\t\t\tClass\t\tGender\n')

connection=sql.connect(host="localhost",user="root",
passwd="root",database="project")
cursor=connection.cursor()
####### end of connection ####
cursor.execute("select * from student")
data=cursor.fetchall()
if data==' ':
messagebox.showinfo('Exception','Empty table!')
else:
data.pop(0)
for i in data:
text.insert(tk.INSERT,'\t')
text.insert(tk.INSERT,str(i[0]))
text.insert(tk.INSERT,'\t\t')
text.insert(tk.INSERT,i[1])
text.insert(tk.INSERT,'\t\t\t')
text.insert(tk.INSERT,i[2])
text.insert(tk.INSERT,'\t\t\t')
text.insert(tk.INSERT,i[3])

COMPUTER SCIENCE-083 Page | 27


SIVAGIRI VIDYANKETAN, ALUVA

text.insert(tk.INSERT,'\t\t')
text.insert(tk.INSERT,i[4])
text.insert(tk.INSERT,'\n')
text.configure(state='disabled')
connection.close()
student1.mainloop()

def show_student():
global student1,homewindow,stush_window
s=homewindow
s.destroy()

class Window(Frame):
def __init__(self,master=None):
Frame.__init__(self,master)
self.master=master
self.pack(fill=BOTH,expand=1)
load=Image.open("showstu.jpg")
render=ImageTk.PhotoImage(load)
img=Label(self,image=render)
img.image=render
img.place(x=0,y=0)
stush_window=Tk()
win=Window(stush_window)

x=int(((stush_window.winfo_screenwidth())/2)-600)
y=int(((stush_window.winfo_screenheight())/2)-450)

COMPUTER SCIENCE-083 Page | 28


SIVAGIRI VIDYANKETAN, ALUVA

stush_window.geometry("1200x900+{}+{}".format(x,y))
stush_window.title("Student Details")

Button(stush_window,text='PROCEED',width=17,command=print_student).pla
ce(x=400,y=570)

Button(stush_window,text='BACK',width=17,command=showstu_back).place(
x=570,y=570)
stush_window.mainloop()

#############################################################
def signout():
global homewindow

msgbox=messagebox.askquestion('Exit Application','are you sure you want to


exit the application?')
if msgbox=="yes":
homewindow.destroy()
mainwindow()
else:
pass
def about():
global root,homewindow,mainwindow
class Window(Frame):
def __init__(self,master=None):
Frame.__init__(self,master)
self.master=master
self.pack(fill=BOTH,expand=1)

COMPUTER SCIENCE-083 Page | 29


SIVAGIRI VIDYANKETAN, ALUVA

load=Image.open("about.png")
render=ImageTk.PhotoImage(load)
img=Label(self,image=render)
img.image=render
img.place(x=0,y=0)
about_window=Toplevel()
add=Window(about_window)

x=int(((about_window.winfo_screenwidth())/2)-325)
y=int(((about_window.winfo_screenheight())/2)-180)
about_window.geometry("650x361+{}+{}".format(x,y))
about_window.title("ABOUT")
about_window.mainloop()

def help():
mesgbox=messagebox.showinfo('Help',"\n".join(["'Follow the instructions to
use the application easily","please try again'"]))

def fees_details():
global root,homewindow,mainwindow
class Window(Frame):
def __init__(self,master=None):
Frame.__init__(self,master)
self.master=master
self.pack(fill=BOTH,expand=1)
load=Image.open("fees.jpg")
render=ImageTk.PhotoImage(load)

COMPUTER SCIENCE-083 Page | 30


SIVAGIRI VIDYANKETAN, ALUVA

img=Label(self,image=render)
img.image=render
img.place(x=0,y=0)
fees_window=Toplevel()
add=Window(fees_window)

x=int(((fees_window.winfo_screenwidth())/2)-402)
y=int(((fees_window.winfo_screenheight())/2)-244)
fees_window.geometry("804x488+{}+{}".format(x,y))
fees_window.title("FEES")
fees_window.mainloop()

def history():
global root,homewindow,mainwindow
class Window(Frame):
def __init__(self,master=None):
Frame.__init__(self,master)
self.master=master
self.pack(fill=BOTH,expand=1)
load=Image.open("admin.jpg")
render=ImageTk.PhotoImage(load)
img=Label(self,image=render)
img.image=render
img.place(x=0,y=0)
history_window=Toplevel()
add=Window(history_window)

COMPUTER SCIENCE-083 Page | 31


SIVAGIRI VIDYANKETAN, ALUVA

x=int(((history_window.winfo_screenwidth())/2)-379)
y=int(((history_window.winfo_screenheight())/2)-213)
history_window.geometry("758x427+{}+{}".format(x,y))
history_window.title("HISTORY")
history_window.mainloop()

def homepage():
global root,homewindow,txt
class Window(Frame):
def __init__(self,master=None):
Frame.__init__(self,master)
self.master=master
self.pack(fill=BOTH,expand=1)
load=Image.open("homepg.png")
render=ImageTk.PhotoImage(load)
img=Label(self,image=render)
img.image=render
img.place(x=0,y=0)
homewindow=Tk()
add=Window(homewindow)

x=int(((homewindow.winfo_screenwidth())/2)-600)
y=int(((homewindow.winfo_screenheight())/2)-320)
homewindow.geometry("1200x641+{}+{}".format(x,y))

COMPUTER SCIENCE-083 Page | 32


SIVAGIRI VIDYANKETAN, ALUVA

homewindow.title("homewindow Form")

Button(homewindow,text='Exit',width=17,command=signout).place(x=60,y=27
0)

Button(homewindow,text='About',width=17,command=about).place(x=60,y=30
0)

Button(homewindow,text='Help',width=17,command=help).place(x=60,y=330)

menu=Menu(homewindow)

first_item=Menu(menu,tearoff=0)
second_item=Menu(menu,tearoff=0)
third_item=Menu(menu,tearoff=0)
fourth_item=Menu(menu,tearoff=0)

first_item.add_command(label='Show Student
Details',command=show_student)
first_item.add_command(label='Add New Student',command=add_student)
first_item.add_command(label='Delete Student
Details',command=del_student)
first_item.add_command(label='Update Student
Student',command=upd_student)

second_item.add_command(label='Show Staff
Details',command=teacher_details)

third_item.add_command(label="Show Fees
Structure",command=fees_details)

COMPUTER SCIENCE-083 Page | 33


SIVAGIRI VIDYANKETAN, ALUVA

fourth_item.add_command(label="History",command=history)

menu.add_cascade(label='STUDENTS', menu=first_item)
menu.add_cascade(label='TEACHERS', menu=second_item)
menu.add_cascade(label='FEES', menu=third_item)
menu.add_cascade(label='ADMINS', menu=fourth_item)

homewindow.config(menu=menu)
homewindow.mainloop()
############################################
def adminclick():
global value
value=1
def studentclick():
global value
value=2
###########################################
def login1():
global txt_uname,txt_passwd,value
try:
uname=txt_uname.get()
passwd=txt_passwd.get()

connection=sql.connect(host="localhost",user="root",passwd="root",database='
project')
cursor=connection.cursor()
if(len(uname)<0 or len(passwd)<0):

COMPUTER SCIENCE-083 Page | 34


SIVAGIRI VIDYANKETAN, ALUVA

messagebox.showinfo('LOGIN FAIL','Please enter the correct


Username & Password')
txt_uname.delete(0,END)
txt_passwd.delete(0,END)
elif value==1:
cursor.execute("SELECT PASSWD FROM SIGNUP WHERE
UNAME='{}'".format(uname))
data=cursor.fetchall()
if data[0][0]==passwd:
messagebox.showinfo('Login Success','You have been
logged in successfully')
s=root
s.destroy()
homepage()
else:
messagebox.showinfo('LOGIN FAIL','Please check
whether you have entered the correct Username & Password')
txt_uname.delete(0,END)
txt_passwd.delete(0,END)
connection.close()
elif value==2:
cursor.execute("SELECT PASSWD FROM SIGNUP WHERE
UNAME='{}'".format(uname))
data=cursor.fetchall()
if data[0][0]==passwd:
messagebox.showinfo('Login Success','You have been
logged in successfully')
s=root
s.destroy()

COMPUTER SCIENCE-083 Page | 35


SIVAGIRI VIDYANKETAN, ALUVA

homepage()
else:
messagebox.showinfo('LOGIN FAIL','Please check
whether you have entered the correct Username & Password')
txt_uname.delete(0,END)
txt_passwd.delete(0,END)
connection.close()

else:
messagebox.showinfo('please wait','Not created')
txt_uname.delete(0,END)
txt_passwd.delete(0,END)
except EOFError as E:
messagebox.showinfo('Please Try Again !!!',E)

###############################################
def login_page():
global signup_window
s=signup_window
s.destroy()
mainwindow()
###############################################
def signup_reg():
global signup_window,txt_name,txt_uname,txt_email,txt_passwd,root
try:

connection=sql.connect(host="localhost",user="root",passwd="root",database="
project")

COMPUTER SCIENCE-083 Page | 36


SIVAGIRI VIDYANKETAN, ALUVA

cursor=connection.cursor()
name=txt_name.get()
email=txt_email.get()
uname=txt_uname.get()
passwd=txt_passwd.get()
cursor.execute("insert into signup
values('{}','{}','{}','{}');".format(name,email,uname,passwd))
connection.commit()
messagebox.showinfo('Sign up successfully','You can login Now!')
s=signup_window
s.destroy()
mainwindow()
except EOFError as e:
messagebox.showinfo('Sign up fail',e)
def signup_clear():
global txt_name,txt_email,txt_uname,txt_passwd
txt_name.delete(0,END)
txt_email.delete(0,END)
txt_uname.delete(0,END)
txt_passwd.delete(0,END)
def signup():
global signup_window,txt_name,txt_uname,txt_email,txt_passwd,root
main=root
main.destroy()
class Window(Frame):
def __init__(self,master=None):
Frame.__init__(self,master)
self.master=master

COMPUTER SCIENCE-083 Page | 37


SIVAGIRI VIDYANKETAN, ALUVA

self.pack(fill=BOTH,expand=1)
load=Image.open("signup.jpg")
render=ImageTk.PhotoImage(load)
img=Label(self,image=render)
img.image=render
img.place(x=0,y=0)
signup_window=Tk()
add=Window(signup_window)

x=int(((signup_window.winfo_screenwidth())/2)-535)
y=int(((signup_window.winfo_screenheight())/2)-401)
signup_window.geometry('1069x802+{}+{}'.format(x,y))
signup_window.title("Signup Form")

label1=Label(signup_window,text=" Enter Your


Details",width=20,font=("bold",10))
label1.place(x=460,y=140)

label2=Label(signup_window,text="Your Name",width=20,font=("bold",10))
label2.place(x=390,y=200)
txt_name=Entry(signup_window)
txt_name.place(x=550,y=200)

label3=Label(signup_window,text="Email",width=20,font=("bold",10))
label3.place(x=390,y=240)
txt_email=Entry(signup_window)
txt_email.place(x=550,y=240)

COMPUTER SCIENCE-083 Page | 38


SIVAGIRI VIDYANKETAN, ALUVA

label4=Label(signup_window,text="User Name",width=20,font=("bold",10))
label4.place(x=390,y=280)
txt_uname=Entry(signup_window)
txt_uname.place(x=550,y=280)

label5=Label(signup_window,text="Password",width=20,font=("bold",10))
label5.place(x=390,y=320)
txt_passwd=Entry(signup_window,show='*')
txt_passwd.place(x=550,y=320)

Button(signup_window,text='Back',width=6,command=login_page).place(x=40
0,y=370)
Button(signup_window,text='Sign
in',width=10,command=signup_reg).place(x=490,y=370)
Button(signup_window,text='Clear
All',width=10,command=signup_clear).place(x=600,y=370)

signup_window.mainloop()

########################################################
def mainwindow():
class Window(Frame):
def __init__(self,master=None):
Frame.__init__(self,master)
self.master=master
self.pack(fill=BOTH,expand=1)
load=Image.open("mainpg.png")
render=ImageTk.PhotoImage(load)

COMPUTER SCIENCE-083 Page | 39


SIVAGIRI VIDYANKETAN, ALUVA

img=Label(self,image=render)
img.image=render
img.place(x=0,y=0)
global root,txt_uname,txt_passwd,value
root=Tk()
add=Window(root)
x=int(((root.winfo_screenwidth())/2)-521)
y=int(((root.winfo_screenheight())/2)-350)
root.geometry('1043x701+{}+{}'.format(x,y))
root.title("Registration Form")

label=Label(root,text="Register and Sign Up


now!",width=21,font=("bold",17))
label.place(x=685,y=310)

label1=Label(root,text="Username",width=15,font=("bold",15))
label1.place(x=680,y=365)

txt_uname=Entry(root)
txt_uname.place(x=790,y=370)

label2=Label(root,text="Password",width=20,font=("bold",15))
label2.place(x=680,y=415)

txt_passwd=Entry(root,show='*')
txt_passwd.place(x=790,y=420)

v=IntVar(root,1)

COMPUTER SCIENCE-083 Page | 40


SIVAGIRI VIDYANKETAN, ALUVA

radioB1=Radiobutton(root,text='Teacher',width=8,value=2,variable=v,comman
d=adminclick)
radioB1.place(x=740,y=460)

radioB2=Radiobutton(root,text='Admin',width=7,value=1,variable=v,command
=studentclick)
radioB2.place(x=810,y=460)

button2=Button(root,text='or Sign
up',width=20,command=signup).place(x=780,y=530)

button=Button(root,text='Login!',width=35,command=login1).place(x=690,y=4
90)

root.mainloop()

def delete_tableteacher():

connection=sql.connect(host="localhost",user="root",passwd="root",database='
project')
cursor=connection.cursor()

COMPUTER SCIENCE-083 Page | 41


SIVAGIRI VIDYANKETAN, ALUVA

cursor.execute('create table if not exists teacher(admno int unique,name


varchar(30),subject_department varchar(30),age int,gender varchar(30))')
#connection.commit()
cursor.execute('insert into teacher values(1,"Monisha","Computer
Science",29,"Female"),(2,"Steju","Chemistry",30,"Female"),(3,"Krishna","Phys
ics",30,"Female"),(4,"Saritha","Maths",31,"Female"),(5,"Ajitha","Biology",31,"
Female")')
connection.commit()
connection.close()

def delete_tablestudent():

connection=sql.connect(host="localhost",user="root",passwd="root",database='
project')
cursor=connection.cursor()

cursor.execute('create table if not exists student(admno int unique,name


varchar(30),dob date,class varchar(30),gender varchar(30))')
#connection.commit()
cursor.execute('insert into student
values(0000,"JGK","20030517","VI","male")')
connection.commit()
connection.close()

def delete_tablesignup():

COMPUTER SCIENCE-083 Page | 42


SIVAGIRI VIDYANKETAN, ALUVA

connection=sql.connect(host="localhost",user="root",passwd="root",database='
project')
cursor=connection.cursor()
cursor.execute('drop table signup')

cursor.execute('create table if not exists signup(name varchar(30),email


varchar(30),uname varchar(30) unique,passwd varchar(30))')
#connection.commit()
cursor.execute('insert into signup values("JGK","gmail","j","j")')
connection.commit()
print('TABLE SIGNUP SUCCESSFULLY CONNECTED')

cursor.execute('create table if not exists student(admno int unique,name


varchar(30),dob date,class varchar(30),gender varchar(30))')
connection.commit()

#connection.commit()
print("<<<CREATING NEW STUDENT TABLE>>>")
cursor.execute('insert into student
values(0000,"JGK","20030517","VI","male")')
connection.commit()

cursor.execute('create table if not exists teacher(admno int unique,name


varchar(30),subject_department varchar(30),age int,gender varchar(30))')
cursor.execute('insert into teacher values(1,"Monisha","Computer
Science",29,"Female"),(2,"Steju","Chemistry",30,"Female"),(3,"Krishna","Phys
ics",30,"Female"),(4,"Saritha","Maths",31,"Female"),(5,"Ajitha","Biology",31,"
Female")')
connection.commit()

COMPUTER SCIENCE-083 Page | 43


SIVAGIRI VIDYANKETAN, ALUVA

print("<<<CREATING NEW TEACHER TABLE>>>")


connection.close()

connection=sql.connect(host="localhost",user="root",passwd="root")
cursor=connection.cursor()
cursor.execute('Create database if not exists project')
connection.commit()
cursor.execute('Use project')

cursor.execute('create table if not exists signup(name varchar(30),email


varchar(30),uname varchar(30) unique,passwd varchar(30))')
connection.commit()
cursor.execute('select * from signup')
data=cursor.fetchall()
if cursor.rowcount==0:
print("<<<CREATING NEW SIGNUP TABLE>>>")
connection.close()
delete_tablesignup()

elif data[0][2]=='j':
print('TABLE SIGNUP SUCCESSFULLY CONNECTED')
pass
else:
delete_tablesignup()
connection.close()

COMPUTER SCIENCE-083 Page | 44


SIVAGIRI VIDYANKETAN, ALUVA

connection=sql.connect(host="localhost",user="root",passwd="root",database='
project')
cursor=connection.cursor()
cursor.execute('create table if not exists student(admno int unique,name
varchar(30),dob date,class varchar(30),gender varchar(30))')
connection.commit()
cursor.execute('select * from student')
data=cursor.fetchall()
if cursor.rowcount==0:
print("<<<CREATING A NEW STUDENT TABLE>>>")
cursor.execute('drop table student')
connection.close()
delete_tablestudent()

elif data[0][0]==0000:
print('TABLE STUDENT SUCCESSFULLY CONNECTED')
connection.close()

else:
cursor.execute('drop table student')
print('TABLE STUDENT ELSE')
delete_tablestudent()
connection.close()

connection.close()

COMPUTER SCIENCE-083 Page | 45


SIVAGIRI VIDYANKETAN, ALUVA

connection=sql.connect(host="localhost",user="root",passwd="root",database='
project')
cursor=connection.cursor()
cursor.execute('create table if not exists teacher(admno int unique,name
varchar(30),subject_department varchar(30),age int,gender varchar(30))')
connection.commit()
cursor.execute('select * from teacher')
data=cursor.fetchall()
if cursor.rowcount==0:
print("<<<CREATING A NEW TEACHER TABLE>>>")
cursor.execute('drop table teacher')
connection.close()
delete_tableteacher()

elif data[0][0]==1:
print('TABLE TEACHER SUCCESSFULLY CONNECTED')
connection.close()

else:
cursor.execute('drop table teacher')
print('TABLE TEACHER ELSE')
delete_tableteacher()
connection.close()
connection.close
mainwindow()

COMPUTER SCIENCE-083 Page | 46


SIVAGIRI VIDYANKETAN, ALUVA

SCREENCASTS:

COMPUTER SCIENCE-083 Page | 47


SIVAGIRI VIDYANKETAN, ALUVA

COMPUTER SCIENCE-083 Page | 48


SIVAGIRI VIDYANKETAN, ALUVA

COMPUTER SCIENCE-083 Page | 49


SIVAGIRI VIDYANKETAN, ALUVA

COMPUTER SCIENCE-083 Page | 50


SIVAGIRI VIDYANKETAN, ALUVA

COMPUTER SCIENCE-083 Page | 51


SIVAGIRI VIDYANKETAN, ALUVA

COMPUTER SCIENCE-083 Page | 52


SIVAGIRI VIDYANKETAN, ALUVA

COMPUTER SCIENCE-083 Page | 53


SIVAGIRI VIDYANKETAN, ALUVA

COMPUTER SCIENCE-083 Page | 54


SIVAGIRI VIDYANKETAN, ALUVA

COMPUTER SCIENCE-083 Page | 55


SIVAGIRI VIDYANKETAN, ALUVA

COMPUTER SCIENCE-083 Page | 56


SIVAGIRI VIDYANKETAN, ALUVA

COMPUTER SCIENCE-083 Page | 57


SIVAGIRI VIDYANKETAN, ALUVA

COMPUTER SCIENCE-083 Page | 58


SIVAGIRI VIDYANKETAN, ALUVA

COMPUTER SCIENCE-083 Page | 59


SIVAGIRI VIDYANKETAN, ALUVA

SCOPE OF THE PROJECT

• The project can be used for managing details of student and could be directly
connected to a database.
• With modifications, it can be used in schools and colleges.
• With modifications, it can be used for multi-building connectivity using LAN or even
MAN.

COMPUTER SCIENCE-083 Page | 60


SIVAGIRI VIDYANKETAN, ALUVA

BIBLIOGRAPHY

• https://www.wikipedia.org/
• https://stackoverflow.com/
• https://docs.python.org/2/library/tkinter.html
• https://www.python.org/
• https://www.mysql.com/

COMPUTER SCIENCE-083 Page | 61


SIVAGIRI VIDYANKETAN, ALUVA

END OF PROJECT

COMPUTER SCIENCE-083 Page | 62


SIVAGIRI VIDYANKETAN, ALUVA

COMPUTER SCIENCE-083 Page | 63

You might also like