webricated / voting-system-python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Online Voting System for Elections

It is a desktop application made with socket programming in Python. It uses synchronous multithreading.

Requirements

Python Libraries Required :

➔ Pandas

➔ Tkinter

➔ Socket

➔ Subprocess

Tools Used

➢ Programming : Python

➢ Connection : Socket Programming

➢ Protocol : TCP

➢ User Interface : python-tkinter

➢ Data Storage : Using CSV files

➢ Data Updates : python-pandas

➢ OS Calls : python-subprocess

How to Run

  1. Open terminal/command prompt on your PC.

  2. Navigate to ‘Voting’ folder

  3. Run command : "python homePage.py"

  4. A new home page window should open. If this doesn’t happen, check your installations.

  5. Login into Admin using given details in ‘How to Login’ part.

  6. Click on the ‘Run Server’ Button.

  7. Use the rest of the Buttons as per your need.

How to Login

❖ Admin Login :

➔ Admin ID : Admin

➔ Password : admin

❖ Voter Login:

❏ Server should be running for voters to be able to login.

➔ Already registered voter I.Ds : 10001 to 10005

➔ Password (for already registered voters) : abcd

Workflow Description

❖ Inorder Description to run & test this project :

  1. Open terminal & run python homePage.py to open Home Page Window.

  2. Log into Admin and press ‘Run Server’. This will run the Server in a new console window.

  3. Now that the server is running, return to the admin home page window.

  4. Press ‘Register Voter’ and enter details to register a new voter. Remember or note down the ‘Voter ID’ that you will receive on successful registration.

  5. Press ‘Home’ to return to the Home. Now, press ‘Voter Login’ to open the voter login page.

  6. Enter the login details and you are redirected to the Voting Page. You will receive an error message if the Voter is invalid or has already cast a vote.

  7. Cast a Vote. Now on receiving a success message, press home to return to home.

  8. Login into Admin again. Press ‘Show Votes’ to check the votes that all parties have received so far.

  9. Return to Home. You can press ‘New Window’ to open multiple pages and cast a vote concurrently from multiple voters.

Stepwise Output / Test Cases

image-001

Home Page

image-002

Admin Login

image-003

Admin Home

image-004

Register Voter

image-005

Register Success Message

image-006

Voter Login

Test Case 1 : If detail matches, then it welcomes the voter and displays the name and poll symbol of the candidates

image-007

Voting Page

image-008

Vote Casted Successfully Message

image-009

Show Votes

❖ Error Handling :

Test Case 2 : One client can cast a vote ONCE AND ONLY ONCE.

image-010

If the vote already been casted

image-011

If a voter is not registered/invalid voter

image-012

Error while casting vote

❖ Voters casting vote concurrently :

Test Case 3: This system should work perfectly for at least 5 different clients at the same time.

image-013

6 Voters

Server Output

image-014

Database

image-015

Voter Info Database

image-016

Candidate Info Database

Conclusion

For the ‘E-voting system’ project we learned how to implement TCP socket programming using Python. We also learned how to connect multiple clients with one server . As the requirement of the project was to allocate a new thread by server for every new incoming Client,thus to accomplish this requirement we learned how to implement synchronized multithreading in python and implemented it in the code of socket programming.

Flow Chart

img173

About


Languages

Language:Python 100.0%