St.
Thomas’ College of Engineering and Technology
Python GUI (Admission Form)
Department of Computer Science and Engineering
By
Rajkishor Kumar 12200123112(33)
Kuldeep Mahato 12200123077(36)
Ghayas Alam 1220012305(03)
Navid Anjoom 12200123094(04)
Third Semester
Subject Code: PCC-CS393
Subject Name: IT Workshop – Python Laboratory
St. Thomas’ College of Engineering and Technology, Kolkata
Affiliated to
Maulana Abul Kalam Azad University of Technology, West
Bengal
Session: 2024-2025
Department of Computer Science and Engineering
St. Thomas’ College of Engineering and Technology
St. Thomas’ College of Engineering and Technology, Kolkata
Department of Computer Science and Engineering
CONTENTS
Table of Contents Page no.
Abstract
1. Introduction 01
2. Program code 05-13
3. Output 14-16
4. Conclusion 17
Department of Computer Science and Engineering
St. Thomas’ College of Engineering and Technology
Abstract
The B.Tech Admission Form System is designed to simplify the process of collecting and
storing student admission data. Traditionally, admission forms have been filled out on
paper, which can be time-consuming, error-prone, and difficult to manage.
The system uses Python’s Tkinter library to create a graphical user interface (GUI) that
allows prospective students to easily fill out their personal and academic details
The data entered by the user is stored securely in an Excel file, making it easy for the
administrative staff to manage and process. This project replaces traditional paper forms,
offering a faster, more efficient, and error-free method for managing B.Tech admissions.
By providing a simple and efficient solution, this system helps improve the overall
admission process for both students and staff.
Department of Computer Science and Engineering
St. Thomas’ College of Engineering and Technology
Introduction
This project aims to create a B.Tech Admission Form System using Python’s Tkinter library
for the user interface and Excel for storing data. The system allows students to easily fill out
an online admission form by providing their personal details, academic information, and
preferred department. The form collects information such as the student’s name, date of birth,
contact details, guardian details, academic marks, and the department they wish to join. It
also includes a date picker to select the admission date.
Once the student fills out the form, the information is saved into an Excel file, making it easy
for the college to store and manage the data. The system also includes an option to clear the
form and reset all fields, so it can be used for multiple students.
This project replaces the traditional paper-based admission forms and makes the admission
process faster and more accurate. It is easy to use and helps both students and administrative
staffs manage admission details efficiently.
Department of Computer Science and Engineering
St. Thomas’ College of Engineering and Technology
Program code
# import openpyxl and tkinter modules
from openpyxl import *
from tkinter import *
# globally declare wb and sheet variable
# opening the existing excel file
wb = load_workbook(C:\Users\rajki\OneDrive\Desktop\Programming\python programming)
# create the sheet object
sheet = wb.active
def excel():
# resize the width of columns in
# excel spreadsheet
sheet.column_dimensions['A'].width = 30
sheet.column_dimensions['B'].width = 10
sheet.column_dimensions['C'].width = 10
sheet.column_dimensions['D'].width = 20
sheet.column_dimensions['E'].width = 20
sheet.column_dimensions['F'].width = 40
sheet.column_dimensions['G'].width = 50
# write given data to an excel spreadsheet
# at particular location
sheet.cell(row=1, column=1).value = "Name"
sheet.cell(row=1, column=2).value = "DOB"
sheet.cell(row=1, column=3).value = "ADD."
Department of Computer Science and Engineering
St. Thomas’ College of Engineering and Technology
sheet.cell(row=1, column=4).value = "Gender"
sheet.cell(row=1, column=5).value = "Class X"
sheet.cell(row=1, column=6).value = "Class XII"
sheet.cell(row=1, column=7).value = "Dept."
sheet.cell(row=1, column=8).value = "Date of Admission"
# Function to set focus (cursor)
def focus1(event):
# set focus on the course_field box
DOB_field.focus_set()
# Function to set focus
def focus2(event):
# set focus on the sem_field box
ADD._field.focus_set()
# Function to set focus
def focus3(event):
# set focus on the form_no_field box
Gender_field.focus_set()
# Function to set focus
def focus4(event):
# set focus on the contact_no_field box
Class_X_field.focus_set()
# Function to set focus
def focus5(event):
# set focus on the email_id_field box
Class_XII_field.focus_set()
Department of Computer Science and Engineering
St. Thomas’ College of Engineering and Technology
# Function to set focus
def focus6(event):
# set focus on the address_field box
Dept_field.focus_set()
# Function to set focus
def focus7(event):
# set focus on the address_field box
Date_of_admission_field.focus_set()
# Function for clearing the
# contents of text entry boxes
def clear():
# clear the content of text entry box
name_field.delete(0, END)
DOB_field.delete(0, END)
ADD_field.delete(0, END)
Gender_field.delete(0, END)
Class_X_field.delete(0, END)
Class_XII_field.delete(0, END)
Dept_field.delete(0, END)
Date_of_admission_field.delete(0, END)
# Function to take data from GUI
# window and write to an excel file
def insert():
# if user not fill any entry
Department of Computer Science and Engineering
St. Thomas’ College of Engineering and Technology
# then print "empty input"
if (name_field.get() == "" and
DOB_field.get() == "" and
ADD>_field.get() == "" and
Gender_field.get() == "" and
Class X_field.get() == "" and
Class_XII_field.get() == "" and
Dept._field.get() == "" and
Date_of_admission_field.get() == ""):
print("empty input")
else:
# assigning the max row and max column
# value upto which data is written
# in an excel sheet to the variable
current_row = sheet.max_row
current_column = sheet.max_column
# get method returns current text
# as string which we write into
# excel spreadsheet at particular location
sheet.cell(row=current_row + 1, column=1).value = name_field.get()
sheet.cell(row=current_row + 1, column=2).value = DOB_field.get()
sheet.cell(row=current_row + 1, column=3).value = ADD_field.get()
sheet.cell(row=current_row + 1, column=4).value = Gender_field.get()
sheet.cell(row=current_row + 1, column=5).value = Class_X_field.get()
sheet.cell(row=current_row + 1, column=6).value = Class_XII_field.get()
sheet.cell(row=current_row + 1, column=7).value = Dept_field.get()
Department of Computer Science and Engineering
St. Thomas’ College of Engineering and Technology
sheet.cell(row=current_row + 1, column=8).value = Date_of_admission_field.get()
# save the file
wb.save('C:\Users\rajki\OneDrive\Desktop\Programming\python programming')
# set focus on the name_field box
name_field.focus_set()
# call the clear() function
clear()
# Driver code
if __name__ == "__main__":
# create a GUI window
root = Tk()
# set the background colour of GUI window
root.configure(background='light green')
# set the title of GUI window
root.title("registration form")
# set the configuration of GUI window
root.geometry("500x300")
excel()
# create a Form label
heading = Label(root, text="Form", bg="light green")
Department of Computer Science and Engineering
St. Thomas’ College of Engineering and Technology
# create a Name label
name = Label(root, text="Name", bg="light green")
# create a DOB label
DOB = Label(root, text="Course", bg="light green")
# create a Parent address label
ADD = Label(root, text="Semester", bg="light green")
# create a Gender label
Gender = Label(root, text="Form No.", bg="light green")
# create a Class X ,Marks label
Class_X = Label(root, text="Contact No.", bg="light green")
# create a Class XII Marks label
Class_XII = Label(root, text="Email id", bg="light green")
# create a Department label
Dept = Label(root, text="Address", bg="light green")
# create a Date of Admission label
Date_of_admission = Label(root, text="Address", bg="light green")
# grid method is used for placing
# the widgets at respective positions
# in table like structure .
heading.grid(row=0, column=1)
name.grid(row=1, column=0)
DOB.grid(row=2, column=0)
Department of Computer Science and Engineering
St. Thomas’ College of Engineering and Technology
ADD.grid(row=3, column=0)
Gender.grid(row=4, column=0)
Class_X.grid(row=5, column=0)
Class_XII.grid(row=6, column=0)
Dept.grid(row=7, column=0)
Date of admission.grid(row=8, column=0)
# create a text entry box
# for typing the information
name_field = Entry(root)
DOB_field = Entry(root)
ADD_field = Entry(root)
Gender = Entry(root)
Class_X= Entry(root)
Class_XII = Entry(root)
Dept = Entry(root)
Date_of_admission = Entry(root)
# bind method of widget is used for
# the binding the function with the events
# whenever the enter key is pressed
# then call the focus1 function
name_field.bind("<Return>", focus1)
# whenever the enter key is pressed
# then call the focus2 function
DOB_field.bind("<Return>", focus2)
# whenever the enter key is pressed
Department of Computer Science and Engineering
St. Thomas’ College of Engineering and Technology
# then call the focus3 function
ADD_field.bind("<Return>", focus3)
# whenever the enter key is pressed
# then call the focus4 function
Gender_field.bind("<Return>", focus4)
# whenever the enter key is pressed
# then call the focus5 function
Class_X_field.bind("<Return>", focus5)
# whenever the enter key is pressed
# then call the focus6 function
Class_XII_field.bind("<Return>", focus6)
# whenever the enter key is pressed
# then call the focus6 function
Dept_field.bind("<Return>", focus7)
# grid method is used for placing
# the widgets at respective positions
# in table like structure .
name_field.grid(row=1, column=1, ipadx="100")
DOB_field.grid(row=2, column=1, ipadx="100")
ADD_field.grid(row=3, column=1, ipadx="100")
Gender_no_field.grid(row=4, column=1, ipadx="100")
Class_X_no_field.grid(row=5, column=1, ipadx="100")
Class_XII_field.grid(row=6, column=1, ipadx="100")
Department of Computer Science and Engineering
St. Thomas’ College of Engineering and Technology
Dept_field.grid(row=7, column=1, ipadx="100")
Date_of_admission_field.grid(row=8, column=1, ipadx="100")
# call excel function
excel()
# create a Submit Button and place into the root window
submit = Button(root, text="Submit", fg="Black",
bg="Red", command=insert)
submit.grid(row=8, column=1)
# start the GUI
root.mainloop()
Department of Computer Science and Engineering
St. Thomas’ College of Engineering and Technology
Output
Department of Computer Science and Engineering
St. Thomas’ College of Engineering and Technology
Department of Computer Science and Engineering
St. Thomas’ College of Engineering and Technology
Department of Computer Science and Engineering
St. Thomas’ College of Engineering and Technology
Conclusion
Through this project, we have gained hands-on experience with Python and the Tkinter
library to create simple applications with graphical interfaces. We also learned how to
organize and store data using Excel and how to ensure the data entered by users is correct,
helping to avoid mistakes.
Working on this project taught us the importance of creating software that can simplify
everyday tasks. We learned how a digital system can save time, reduce errors, and improve
the efficiency of processes that were once done on paper. Additionally, we learned how to
design a system that is easy to use for everyone, even those without technical knowledge.
One of the most important things we learned was how to plan and put together a project.
Designing the form, storing the data, and making sure everything worked smoothly
required careful planning and testing.
In conclusion, the B.Tech Admission Form System is a great way to make the admission
process more efficient. This project helped us improve our technical skills and showed us
how technology can solve real-world problems. In the future, we plan to add even more
features, such as online submission, email notifications, and linking the system to a
database to make it better and more useful.
Department of Computer Science and Engineering