0% found this document useful (0 votes)
6 views22 pages

E-Voting System Project Overview

The document outlines a Computer Science project titled 'E-Voting System' developed by Rishi Mehta, which aims to create a secure and efficient electronic voting platform using Python and MySQL. The system allows registered voters to cast their votes electronically while ensuring data security and real-time results, thereby reducing electoral fraud and manual errors. It includes features for both voters and administrators, facilitating a streamlined voting process and management of election results.
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)
6 views22 pages

E-Voting System Project Overview

The document outlines a Computer Science project titled 'E-Voting System' developed by Rishi Mehta, which aims to create a secure and efficient electronic voting platform using Python and MySQL. The system allows registered voters to cast their votes electronically while ensuring data security and real-time results, thereby reducing electoral fraud and manual errors. It includes features for both voters and administrators, facilitating a streamlined voting process and management of election results.
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

New Beersheba School

CLASS XII
COMPUTER SCIENCE PROJECT

“E-Voting system”

Submitted By: Rishi Mehta


Class: XII 'C'
Roll No: 26
Submitted To: Mr. Sumit Bisht

2025-2026
ACKNOWLEDGEMENT

I would like to express my sincere


thanks to my Computer Science teacher,
Mr. Sumit Bisht, for their invaluable
guidance and support in completing this
project.

I also thank my school, New Beersheba,


for providing the resources and
environment to complete this project
successfully.

Finally, I am grateful to my parents and


friends for their encouragement
throughout the project.

Rishi Mehta
Class XII 'C'
CERTIFICATE

This is to certify that the project work


titled 'E-Voting System' has been
successfully completed by Rishi Mehta,
a student of Class XII 'C', Roll No. 26,
during the academic session 2025-26
under the guidance of [Link] Bisht.

Signature of Teacher- Signature of Examiner-


ABSTRACT

The E-Voting System is a computerized


voting application designed to facilitate
secure,transparent,and efficient
elections. This project uses Python for
the user interface and MySQL for
database management to store voter
detail,candidate information,and voting
[Link] system allow registered
voters to cast their electronically while
ensuring that each voter and vote only
[Link] also enable administrator to
view real time voting results with
password [Link] project aims
to reduce electoral fraud , save time,and
provide an easy to use platform for
conducting elections digitally.
Introduction

Voting is an essential part of any democratic


society as it allows citizens to choose their
leaders and voice their opinions. Traditional
paper-based voting methods can be time-
consuming, prone to errors, and sometimes
vulnerable to fraud or manipulation. To
overcome these challenges, electronic voting
systems (E-Voting Systems) have been
developed to make the voting process faster,
more accurate, and more secure.

This project focuses on building a simple and


reliable E-Voting System using Python and
MySQL.

The system enables registered voters to cast


their votes electronically, ensures that each
voter can vote only once, and provides
administrators with a secure way to view
voting results. By automating the voting
process, this project aims to improve the
transparency and efficiency of elections.
Objective of the Project: E-Voting
System

The objective of this project is to design and


develop a secure, user-friendly, and efficient
Electronic Voting System (E-Voting System)
that allows users to cast their votes digitally.
This system aims to eliminate the need for
physical voting processes, reduce manual
errors, ensure transparency, and provide real-
time results.

The key objectives include:


To develop a digital platform for voting that simplifies
the voting process for both voters and administrators.
To ensure data security and voter authentication
through login systems and basic access controls.
To minimize human intervention in vote counting to
avoid errors and manipulation.
To allow real-time result generation after voting is
closed.
To promote eco-friendly practices by reducing the use of
paper and physical infrastructure.
To simulate the voting process for educational purposes
and better understanding of e-governance systems.
Tools and
Technologies -

1- Python 3.13

2- MySQL

3- mysql-connector-
python
System
Requirements-
1-computer or laptop
2-python
3-MySQL
System design_-(MySQL )

creating database as evoting

creating tables as user and candidates


Inserting sample users

Inserting sample candidates


SOURCE CODE-
Installing module:

Modules Imported:

tkinter: Python's built-in module to create GUI (Graphical User Interfaces).


[Link]: Connects Python to a MySQL database.

Database Connection:

Establishes a connection to the MySQL database evoting.


cursor: Used to execute SQL queries (SELECT, INSERT, UPDATE, etc.).

The Main Application Class:

__init__: Constructor that sets up the app window and starts with the login screen.
self.current_user: Stores the currently logged-in user (used to track who voted).
Login Screen :

Clears the screen and shows username/password entry fields.


Adds a Login button that triggers the [Link]() function when clicked.

Clear GUI Window :

Destroys all current GUI elements in the window.


Used to change between screens (e.g., login → voting).

Login Function :

Retrieves input credentials and checks if they exist in the user table.

If a user is found:
If the role is admin → go to admin panel ,If the user has already voted → show message
,Otherwise → show voting screen.
If not found → show login error.
Voting Screen:

Clears screen and displays a list of candidates from the candidate table.

Adds a button for each candidate.


Clicking a button triggers cast_vote() with the selected candidate_id.

Cast Vote :

Increases vote count for the candidate.


Marks user as having voted.
Commits the changes to the database.
Shows success message and exits the app .

Admin Screen :

Clears screen and shows options for admin:


Add a new candidate
View election results
Exit the app

Add Candidate :

Asks admin for candidate name and party.


Adds new candidate to the database.
View Results :

Opens a new window showing vote count for each candidate.

Start the App:

Creates the main window and runs the app using mainloop().

Summary of How It Works :


Login:
Checks username & password; redirects based on role

Voting
Displays list of candidates; allows one-time vote

Admin
Can add candidates and view live vote counts

Database
Tracks users, voting status, candidates, and votes
import tkinter as tk
from tkinter import messagebox, simpledialog
import [Link]
conn = [Link](
host="localhost",
user="root",
password="1234567890",
database="evoting"
)
cursor = [Link]()

class EVotingApp:
def _init_(self, root):
[Link] = root
[Link]("E-Voting System")
self.current_user = None
self.login_screen()

def login_screen(self):
self.clear_window()

[Link]([Link], text="Username:").pack()
self.username_entry = [Link]([Link])
self.username_entry.pack()

[Link]([Link], text="Password:").pack()
self.password_entry = [Link]([Link], show="*")
self.password_entry.pack()

[Link]([Link], text="Login",
command=[Link]).pack(pady=10)

def clear_window(self):
for widget in [Link].winfo_children():
[Link]()
def login(self):
username = self.username_entry.get()
password = self.password_entry.get()

[Link]("SELECT * FROM user WHERE


username=%s AND password=%s", (username, password))
user = [Link]()

if user:
self.current_user = user
if user[4] == 'admin':
self.admin_screen()
else:
if user[3]:
[Link]("Info", "You have
already voted!")
else:
self.voting_screen()
else:
[Link]("Error", "Invalid credentials")

def voting_screen(self):
self.clear_window()
[Link]([Link], text="Vote for a candidate").pack()

[Link]("SELECT * FROM candidate")


candidate = [Link]()

for candidate in candidate:


[Link]([Link], text=f"{candidate[1]}
({candidate[2]})",
command=lambda cid=candidate[0]:
self.cast_vote(cid)).pack(pady=2)
def cast_vote(self, candidate_id):
[Link]("UPDATE candidate SET votes = votes
+ 1 WHERE candidate_id = %s", (candidate_id,))
[Link]("UPDATE user SET has_voted = TRUE
WHERE user_id = %s", (self.current_user[0],))
[Link]()
[Link]("Success", "Your vote has been
cast!")
[Link]()

def admin_screen(self):
self.clear_window()
[Link]([Link], text="Admin Panel").pack()

[Link]([Link], text="Add Candidate",


command=self.add_candidate).pack(pady=5)
[Link]([Link], text="View Results",
command=self.view_results).pack(pady=5)
[Link]([Link], text="Exit",
command=[Link]).pack(pady=5)

def add_candidate(self):
name = [Link]("Input", "Candidate
Name:")
party = [Link]("Input", "Party:")
if name and party:
[Link]("INSERT INTO candidate (name,
party) VALUES (%s, %s)", (name, party))
[Link]()
[Link]("Success", "Candidate added
successfully")

def view_results(self):
result_window = [Link]([Link])
result_window.title("Election Results")
[Link]("SELECT * FROM candidate")
results = [Link]()

for candidate in results:


[Link](result_window, text=f"{candidate[1]}
({candidate[2]}): {candidate[3]} votes").pack()

root = [Link]()
app = EVotingApp(root)
[Link]()
OUTPUT-
After f5 :

Insert username and password:


1)login as an admin ;

admin panel – 1) add candidates:

now we can add candiate


we can view votes(now 0 votes)

login as user:

now we can vote:

votes can bee seen in admin login

Admin can add candiates and view vote


User can give vote
Conclusion:

The Evotingsystem project sucessfully demonstrates


the application of python(tkinter) and MySQL in
developing a real world GUI based voting platform it
simulates voting process where:
1) User can log in with valid credentials,
2) Voters are allowed to caste their vote only once,
3) Admin can manage candidates and view live
election result.
This project helped enhance understanding of key
computer science concepts such as:
1)Database connectivity using [Link],
2)GUI developement using tkinter
3)Role based access control(Admin vs Voter)
4)Handling user input and validation
5)Real world application logic and structure
Overall the project has achieved its objective of
providing a simple yet effective voting [Link] also
highlights the potential of technology in making
democratic processes more efficient,secure,and
transparent.
Bibliography:

Python documentation
source [Link]
used for understaing Python
syntax,functions,and modules.
MySQL documentation
source [Link] referred
for SQL queries,database design,and
MySQL python integration.
School Textbook
Youtube
Google

You might also like