Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 18

Kendriya Vidyalaya

Ahmedabad

A PROJECT REPORT ON

TIME TABLE MANAGEMENT

Submitted to Submitted By

SHRI JITENDRA KANTILAL VARATIYA Tirth Vadhvana

PGT(COMPUTER SCIENCE) XII A


Kendriya Vidyalaya
Ahmedabad

CIRTIFICATE

THIS IS TO CERTIFY THAT Abhishek Jain OF CLASS XII, ROLL NO.

12102 HAS SUCESSFULLY COMPLETED THE PROJECT ENTITLED

TIMETABLE MANAGEMENT SYSTEM FOR THE SUBJECT OF

COMPUTER SCIENCE NEW (083) FOR FULLFILLMENT OF AISSCE

PRACTICAL EXAMINATION 2022-23 .

INTERNAL EXAMINER EXTERNAL EXAMINAR

PRINCIPAL
Index
 Certificate

 Acknowledgement

 Introduction

 Software / Hardware Requirement

 Database description

 Source Code

 Output

 Bibliography
Introduction
 Timetable Management

A Time Table Management System


Project in Python is a universal
requirement for school scheduling. The
system can be used to schedule new
classes, cancel existing classes, and make
other timetable modifications. It is
straightforward and efficient. The
timetable is one of the most significant aspects
of a school. That is why all schools, large and
small, adhere to a schedule. A schedule divides
the school day into separate times and assigns
different subjects to each session. A time chart
lists the activities that must be completed in a
school on a specific day. As a result, it is very
important in schools.
Hardware & Software
Requirements

 Modern Operating System : Windows 7,8,10,11

 X86 64-bit CPU (Intel / AMD architecture)

 4 GB minimum Ram Support

 5 GB minimum Free disk Space (For smooth


running of program)

Most users will find that any computer bought in


recent years will meet (and usually exceed) these
hardware requirements.
Database description
To build the Timetable management system project we
used the MYSQL connectivity, inserting the values in table
etc.
 MYSQL connectivity helps us to connect the table in
mysql database to Python.

Project File Structure


 MYSQL connectivity.
 Importing libraries.
 Creating an input screen.
 Selection for a Record.
 Inserting a value.
 Assessing a Table

Codes
import mysql.connector as mycon #import mysql.connector
package
import sys

hname = input("Enter MySQL Host Name (Default value is


localhost) ")
portno = input("Enter MySQL Port Number (Default value
is 3306) ")
uname = input("Enter MySQL User Name (Default value is
root) ")
pwd = input("Enter MySQL Password (Default value is root
for user root) ")
con =
mycon.connect(host='{}'.format(hname),port='{}'.format(p
ortno),user='{}'.format(uname),\
passwd='{}'.format(pwd)) #New style
of Text Formatting is used
if con.is_connected(): #True if connected otherwise
False
print("Python is connected to MYSQL Successfully.")
cur = con.cursor() #Creating Cursor
cur.execute("Create database if not exists
onlineclass") #Creating Database
cur.execute("use onlineclass") #Using Database
cur.execute("create table if not exists
timetable(ttnum int(5) primary key, clss char(5),\
section char(5),day1 char(15),time1 char(10), subject
char(25))") #Creating Table
while True: #Infinite Loop
print("\nWelcome to Timetable Manager Of KV
ONGC.\
\nInput First Character of Operation to Start.\n")
print("RECORD Insertion-I , Retreival-R ,
Updation-U , Deletion-D , Showtables-S , Exit-E\n")
inp = input("Enter Your Choice :").upper()
if inp == 'I':
print("Inserting a Record")
ttnum = int(input("Enter Table Number: "))
clss = input("Enter Time Table Class: ")
section = input("Enter Class Section: ")
day1 = input("Enter Day: ")
time1 = input("Enter Time Table period: ")
subject = input("Enter Subject ")
qry = "insert into timetable
(ttnum,clss,section,day1,time1,subject) values \
({},'{}','{}','{}','{}','{}')".format(ttnum,clss,section
,day1,time1,subject) #Inserting Record
cur.execute(qry)
con.commit()
count = cur.rowcount
print(count," record is inserted
successfully.")
print("Press Enter to continue.")
input()
elif inp == 'R':
print("Retrieve a Record")
qry = "Select * from timetable order by
ttnum" #Accessing Records
cur.execute(qry)
data = cur.fetchall()
count = cur.rowcount
print(count," records are retrived
successfully.")
#New concept of Text formatting is used to
display data in Tabular Form

print("|----------|-------|----------|-----------|------
-|-------------------------|")
print("| TTNumber | Class | Section | Day
| Time | Subject |")

print("|----------|-------|----------|-----------|------
-|-------------------------|")
for row in data:
print("| {0:<9d}| {1:<6s}| {2:<9s}|
{3:<10s}| {4:<6s}| {5:<24s}|\
".format(row[0],row[1],row[2],row[3],row[4],row[5]))

print("|----------|-------|----------|-----------|------
-|-------------------------|")
print("Press Enter to continue.")
input()
elif inp == 'U':
print("Update a Record")
ttnum = int(input("Enter Time Table Number
"))
qry = "Select * from timetable where ttnum =
{} order by ttnum".format(ttnum)
cur.execute(qry)
row = cur.fetchone()
count = cur.rowcount
print(count," record is searched
successfully.")

print("|----------|-------|----------|-----------|------
-|-------------------------|")
print("| TTNumber | Class | Section | Day
| Time | Subject |")
print("|----------|-------|----------|-----------|------
-|-------------------------|")
print("| {0:<9d}| {1:<6s}| {2:<9s}|
{3:<10s}| {4:<6s}| {5:<24s}|\
".format(row[0],row[1],row[2],row[3],row[4],row[5]))

print("|----------|-------|----------|-----------|------
-|-------------------------|")
clss = input("Enter Class (New) or . old
value ")
section = input("Enter Section (New) or .
old value ")
day1 = input("Enter Day (New) or . old value
")
time1 = input("Enter Time Table period (New)
or . old value ")
subject = input("Enter Subject (New) or .
old value ")
if clss == '.':
clss = row[1]
if section == '.':
section = row[2]
if day1 == '.':
day1 = row[3]
if time1 == '.':
time1 = row[4]
if subject == '.':
subject = row[5]
qry = "update timetable set clss = '{}',
section = '{}', day1 = '{}',\
time1 = '{}', subject = '{}' where ttnum =
{}".format(clss,section,day1,time1,subject,ttnum)
cur.execute(qry)
con.commit()
count = cur.rowcount
print(count," record is updated
successfully.")
print("Press Enter to continue.")
input()
elif inp == 'D':
print("Delete a Record")
ttnum = int(input("Enter Time Table Number
"))
qry = "Select * from timetable where ttnum =
{}".format(ttnum)
cur.execute(qry)
row = cur.fetchone()
count = cur.rowcount
print(count," record is searched
successfully.")
print("|----------|-------|----------|-----------|------
-|-------------------------|")
print("| TTNumber | Class | Section | Day
| Time | Subject |")

print("|----------|-------|----------|-----------|------
-|-------------------------|")
print("| {0:<9d}| {1:<6s}| {2:<9s}|
{3:<10s}| {4:<6s}| {5:<24s}|\
".format(row[0],row[1],row[2],row[3],row[4],row[5]))

print("|----------|-------|----------|-----------|------
-|-------------------------|")
qry = "delete from timetable where ttnum =
{} order by ttnum".format(ttnum)
cur.execute(qry)
print("Record is deleted successfully.")
con.commit()
count = cur.rowcount
print(count," record is deleted
successfully.")
print("Press Enter to continue.")
input()
elif inp == 'S':
print("Search a Record")
ttnum = int(input("Enter Table Number "))
qry = "Select * from timetable where ttnum =
{} order by ttnum".format(ttnum)
cur.execute(qry)
row = cur.fetchone()
count = cur.rowcount
print(count," record is searched
successfully.")

print("|----------|-------|----------|-----------|------
-|-------------------------|")
print("| TTNumber | Class | Section | Day
| Time | Subject |")

print("|----------|-------|----------|-----------|------
-|-------------------------|")
print("| {0:<9d}| {1:<6s}| {2:<9s}|
{3:<10s}| {4:<6s}| {5:<24s}|\
".format(row[0],row[1],row[2],row[3],row[4],row[5]))

print("|----------|-------|----------|-----------|------
-|-------------------------|")
print("Press Enter to continue.")
input()
elif inp == 'E':
con.close()
print("Terminating Program")
sys.exit(0)
else:
print("Wrong Input Try Again")
print("Press Enter to continue.")
input()
else:
print("Python is not connected to MYSQL
Successfully. Connection Failed.")
sys.exit()

Output
 Output Screen

 Choosing show tables


 Second output

 Choosing Insert items


Bibliography
 Sumita Arora Class 12

 Python Libraries

 www.python.org

 www.kvspython.com

You might also like