Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
4 views19 pages

CS Project File

The document outlines a Computer Science project completed by Preiyansh Jha and Shivansh Mishra, focusing on a login system application developed using Python. It details the project's phases, including source code, layout, and functionalities such as user authentication and database management for student records. Acknowledgements and a certificate of completion are also included, highlighting the support received from their supervisor and school faculty.

Uploaded by

e9209961
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views19 pages

CS Project File

The document outlines a Computer Science project completed by Preiyansh Jha and Shivansh Mishra, focusing on a login system application developed using Python. It details the project's phases, including source code, layout, and functionalities such as user authentication and database management for student records. Acknowledgements and a certificate of completion are also included, highlighting the support received from their supervisor and school faculty.

Uploaded by

e9209961
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

2025-26

COMPUTER SCIENCE PROJECT


Table Of content

SNo Title Page


1 Acknowledgement 1
2 Certificate Of Completion 2
3 Vision & Idea 3
4 Working (Phase-1) 4
5 Source Code & Layout (Phase-1) 5-8
6 Working (Phase-2) 8-9
7 Source Code & Layout (Phase-2) 9-14
8 Main Functioning 14-16
9 Vote Of Thanks 17

1
Acknowledgement
We would like to extend our deepest gratitude to everyone who contributed to
the success of this project. This journey has been one of collaboration,
learning, and mutual support, culminating in a project that we are proud to
present.

First and foremost, we express our sincere thanks to our project supervisor,
Mrs Vandana, whose guidance, expertise, and patience were instrumental in
steering this project towards its completion. Her insights and feedback were
invaluable, and her encouragement motivated us to excel.

We are also deeply grateful to Sant Nirankari Public School’s faculty, for
providing us with the resources and environment conducive to our research
and development efforts. Their assistance in navigating academic and
logistical challenges was crucial.

We would also like to acknowledge the support of our families and friends,
who provided encouragement, understanding, and motivation throughout the
duration of this project. Their belief in our abilities fuelled our determination
and commitment.

Lastly, we extend our gratitude to each other, the members of this project; it
was a collaborative effort that required dedication, compromise, and
teamwork. We have grown individually and collectively through this
experience, gaining not just knowledge but also friendships that we treasure.

This project report is not only a reflection of our hard work but also a
testament to the support and guidance we received from all those mentioned
above. Thank you for making this journey memorable and our project a
success.

Preiyansh Jha & Shivansh Mishra


20th July 2025

2
Certificate of Completion

Sant Nirankari Public School


Department of Computer Science

This is to proudly certify that


Preiyansh Jha and Shivansh Mishra
has successfully completed the Computer Science project

The project was carried out under the guidance of Mrs Vandana.

We recognize the dedication, technical skills, and innovation


demonstrated throughout the development of the project.

Date of Issue: 7th August 2025

Mrs Vandana
Project Supervisor
(Signature)

3
Idea & Vision
The main idea and theme of the project is
to present the idea of a login system
through the means of python programming
where the application can be used only by
the people registered by the program. The
user will get to see an interface where
the users will authenticate themselves
and once the authentication is done the
user will be able to use the application.
The login record will also be saved every
time a new login takes place. The main
project is regarding an ‘Aspirant’
database where records of students are
available and can be edited, updated,
deleted, viewed and saved.

4
Working of the program
For 1st phase:
The program’s working takes
place in 3 steps
1) Once the program is opened a
screen appears which asks for
the username and password for
logging into the application.
2) After the fields are filled
the program matches the records
from the files and checks
whether the user exists or not.
3) If the user record is found
then the program main window
opens, else a message is
displayed stating that the
username or password is
invalid.

5
Source Code (1st Phase)
The following is the code of the 1st
phase of the program along with its
layout.
from tkinter import *
import tkinter.messagebox as tmsg
# Main window
root = Tk()
root.title("Login")
root.geometry("300x200")
# Frames
f1 = Frame(root, bg='grey', relief=SUNKEN, borderwidth=5)
f1.grid(row=2, column=1, padx=5, pady=5)
f2 = Frame(root, bg='grey', relief=SUNKEN, borderwidth=5)
f2.grid(row=3, column=1, padx=5, pady=5)
# Labels
Label(root, text='Aspirants Record Room', font=('lucida
calligraphy', 15, 'bold'), fg='blue').grid(row=1, column=0,
columnspan=2)
Label(root, text='Username', font=('consolas', 12, 'bold'),
fg='magenta').grid(row=2, column=0)
Label(root, text='Password', font=('consolas', 12, 'bold'),
fg='magenta').grid(row=3, column=0)
# Entries
user = Entry(f1, justify=CENTER, font=('Times New Roman', 10),
width=29)
user.pack()
password = Entry(f2, justify=CENTER, font=('Times New Roman', 10),
width=29, show="●")
password.pack()
# Commands
def enter(event):
root.config(cursor='hand2')
def leave(event):
root.config(cursor="")
def verify():
global user
global password
query = f'{user.get()}: {password.get()}'
with open('Users.txt') as f:
lines = f.read().splitlines()
f.close()
if query in lines:

6
tmsg.showinfo('Login Successfull', 'You are successfully
logged in....')
elif (user.get()) == '' or (password.get()) == '':
tmsg.showwarning('Warning', 'You cannot leave any field
empty.')
else:
tmsg.showerror('Error', 'Looks like the username or
password is incorrect.')
# Buttons
b1 = Button(root, text='Login In', font=('lucida calligraphy', 15,
'bold'), width=15, activebackground='orange', command=verify,
activeforeground='white', bg='yellow', fg='red')
b1.bind('<Enter>', enter)
b1.bind('<Leave>', leave)
b1.grid(row=4, column=0, columnspan=2)
# Mainloop
root.mainloop()

Layout (1st Phase)

Enter correct details in each field and click on the


‘Login In’ button to activate the main program.

Points to remember:

1) No field should be left blank


2) Enter correct details and beware of spellings
3) Login will be successful only if your username
and password is saved from reference
file(where username and password are saved)

7
A reference files ‘Users.txt’ where the username
and password are saved correspondingly and if
the record matches with the file then your
program activates

Or

On providing the details as shown above our


output will be

8
This warning dialogue box appears when the
user have left a field blank and pressed the
login button.

This error dialogue box appears


when the username, password or
both of them are incorrect.

Working of the program


For 2nd phase:
1) If there is any pre-existing
record then operations like
insert, delete, and search can
be performed.
2) In the case if there is an
empty set of records then user
9
can create one and modify it
accordingly.

Operations available for 2nd


phase:
1) Insert
2) Search or Filter
3) View
4) Delete
5) Update
6) Clear (Entry Fields)

Source Code (2nd Phase)


from tkinter import *
import csv
import pandas as pd
# Main window
root = Tk()
root.title('Aspirant Record Room')
# Functions
def fetch():
global console
with open("Records.csv", 'r') as f:
reader = csv.reader(f)
# header = next(reader)
output = ""
console.delete(1.0, END)
for rows in reader:

10
console.insert(END, f'{rows}\n')
f.close()
def insert():
global e1, e2, e3, console
with open('Records.csv','a+', newline='') as f:
writer = csv.writer(f)
name = e2.get()
marks = e3.get()
roll = e1.get()
writer.writerow([roll, name, marks])
f.close()
console.delete(1.0, END)
console.insert(1.0, 'The record has been inserted...')
def clear():
global e1, e2, e3, console
e1.delete(0, END)
e2.delete(0, END)
e3.delete(0, END)
console.delete(1.0, END)
def search():
global e1, e2, e3, console
roll = e1.get()
name = e2.get()
marks = e3.get()
console.delete(1.0,END)
if roll == '' and name == '' and marks == '':
console.insert(1.0, "Please provide any sort of information
to proceed with the query.")
elif roll != "":
with open("Records.csv", 'r') as f:
reader = csv.reader(f)
header = next(reader)
print(header)
for rows in reader:
if roll in rows:
console.insert(1.0, f'{rows}')
else:
pass
f.close()
elif name != "":
with open("Records.csv", 'r') as f:
reader = csv.reader(f)
header = next(reader)
print(header)
for rows in reader:
if name in rows:
console.insert(END, f'{rows}\n')
else:
pass

11
elif marks != '':
with open("Records.csv", 'r') as f:
console.delete(1.0, END)
reader = csv.reader(f)
header = next(reader)
print(header)
for rows in reader:
if marks in rows:
console.insert(END, f'{rows}')
else:
pass
def update():
global e1, e2, e3, console
roll = e1.get()
name = e2.get()
marks = e3.get()
console.delete(1.0,END)
df = pd.read_csv("Records.csv")
df.loc[df['Roll_No'] == int(roll), 'Name'] = name
df.loc[df['Roll_No'] == int(roll), 'Marks'] = marks
df.to_csv("Records.csv", index=False)
with open('Records.csv') as f:
reader = csv.reader(f)
for row in reader:
console.insert(END, f'{row}\n')

def delete():
global e1, e2, e3, console
roll = e1.get()
name = e2.get()
marks = e3.get()
console.delete(1.0,END)
df = pd.read_csv("Records.csv")
roll_to_delete = int(roll)
name_to_delete = name
marks_to_delete = marks
if roll != '':
df = df[df['Roll_No'] != roll_to_delete]
df.to_csv("Records.csv", index=False)
elif name != '':
df = df[df['Name' != name_to_delete]]
df.to_csv("Records.csv", index=False)
elif marks != '':
df = df[df['Marks'] != marks_to_delete]
df.to_csv("Records.csv", index=False)
with open('Records.csv') as f:
reader = csv.reader(f)
for row in reader:
console.insert(END, f'{row}\n')

12
#Frame
mainFrame = Frame(root)
mainFrame.grid(row=1, column=0)
ef1 = Frame(mainFrame, relief=SUNKEN, bg='grey', border=3)
ef1.grid(row=0, column=1, padx=16, pady=5, columnspan=3)
ef2 = Frame(mainFrame, relief=SUNKEN, bg='grey', border=3)
ef2.grid(row=1, column=1, padx=16, pady=5, columnspan=3)
ef3 = Frame(mainFrame, relief=SUNKEN, bg='grey', border=3)
ef3.grid(row=2, column=1, padx=16, pady=5, columnspan=3)
# Widgets
Label(root, text='Record Rooom', font=('Lucida Calligraphy', 15,
'bold')).grid(row=0, column=0, pady=5, columnspan=2)
Label(root, text='Output Console', font=('Lucida Calligraphy', 15,
'bold')).grid(row=3, column=0, pady=5, columnspan=2)
Label(mainFrame, text='Roll No.', font=('Consolas', 15,
'bold')).grid(row=0, column=0)
Label(mainFrame, text='Name', font=('Consolas', 15,
'bold')).grid(row=1, column=0)
Label(mainFrame, text='Percentile', font=('Consolas', 15,
'bold')).grid(row=2, column=0)
e1 = Entry(ef1, width=16, justify=CENTER, font=('arial black', 13))
e1.grid(row=0, column=1)
e2 = Entry(ef2, width=16, justify=CENTER, font=('arial black', 13))
e2.grid(row=1, column=1)
e3 = Entry(ef3, width=16, justify=CENTER, font=('arial black', 13))
e3.grid(row=2, column=1)

b1 = Button(mainFrame, text='Insert Record', font=('lucida console',


10, 'bold'), activebackground='orange', activeforeground='white',
width=12, pady=5, padx=5, relief=RIDGE, borderwidth=5,
command=insert)
b1.grid(row=3, column=0, padx=5, pady=5)

b4 = Button(mainFrame, text='Search Record', font=('lucida console',


10, 'bold'), activebackground='orange', activeforeground='white',
width=12, pady=5, padx=5, relief=RIDGE, borderwidth=5,
command=search)
b4.grid(row=3, column=2, padx=5, pady=5)

b5 = Button(mainFrame, text='View Record', font=('lucida console',


10, 'bold'), activebackground='orange', activeforeground='white',
width=12, pady=5, padx=5, relief=RIDGE, borderwidth=5,
command=fetch)
b5.grid(row=3, column=1, padx=5, pady=5)

b6 = Button(mainFrame, text='Update', font=('lucida console', 10,


'bold'), activebackground='orange', activeforeground='white',

13
width=12, pady=5, padx=5, relief=RIDGE, borderwidth=5,
command=update)
b6.grid(row=4, column=0, padx=5, pady=5)

b7 = Button(mainFrame, text='All Clear', font=('lucida console', 10,


'bold'), activebackground='orange', activeforeground='white',
width=12, pady=5, padx=5, relief=RIDGE, borderwidth=5,
command=clear)
b7.grid(row=4, column=1, padx=5, pady=5)

b7 = Button(mainFrame, text='Delete', font=('lucida console', 10,


'bold'), activebackground='orange', activeforeground='white',
width=12, pady=5, padx=5, relief=RIDGE, borderwidth=5,
command=delete)
b7.grid(row=4, column=2, padx=5, pady=5)

console = Text(root, width=50, height=10, font=('Comic Sans MS',


10))
console.grid(row=4, column=0, columnspan=3, padx=5, pady=5)
# Mainloop
root.mainloop()

Layout (Phase-2)

This GUI consists of 3 Entry fields where


the data will be inserted, 5 buttons for
running the task and 1 button for
clearing all the fields and 1 output
console where the output of the query
button will occur and result will be
displayed.

14
A pre-existing CSV file where the
records of the aspirants are present
which will be used further by the
program as per the users will.

Main Functioning

The ‘View’ button shows all the


records of the file in the
console.

15
The ‘Insert’ button adds a new
row of details in the file which
can be viewed by the ‘View’
button

The “Search” command can be used in the all three criteria.


You can filter out record as per requirement i.e. by providing
‘Roll No’, ‘Name’ or ‘Percentile’.

16
After

Updating

After filling the details when the update button


is pressed then the record gets updated in the
file.

After filling the desired


criteria for deleting a record
when the ‘Delete’ button is
pressed the record from the
file is deleted.

17
Vote Of Thanks
I would like to express my sincere gratitude to all those who
supported me throughout the course of this Computer Science project.

First and foremost, I am deeply thankful to my Computer Science


teacher, Mrs Vandana, for their valuable guidance, continuous
encouragement, and constructive feedback, which played a crucial
role in the successful completion of this project.

I would also like to extend my thanks to Sant Nirankari Public


School for providing the necessary resources and a conducive
learning environment.

A special word of thanks to my classmates, friends, and family


members for their constant motivation and support during the project.

Lastly, I appreciate all the online platforms, tutorials, and


documentation that helped deepen my understanding and improve the
quality of my work.

This project has been a great learning experience, and I am truly


grateful to everyone who contributed, directly or indirectly, to its
completion.

Thank you.

18

You might also like