forked from jpb1991/python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathElectoral_Votes_Simulator_Documentation.html
115 lines (109 loc) · 7.06 KB
/
Electoral_Votes_Simulator_Documentation.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Electoral Votes Simulator Documentation</title>
<style>
body {
font-family: Arial, sans-serif;
line-height: 1.6;
margin: 20px;
}
h1, h2 {
color: #333;
}
code {
background-color: #f4f4f4;
padding: 2px 5px;
border-radius: 5px;
}
.container {
max-width: 800px;
margin: auto;
}
p {
margin: 20px 0;
}
footer {
margin-top: 40px;
padding-top: 20px;
border-top: 1px solid #ccc;
text-align: center;
color: #666;
}
</style>
</head>
<body>
<div class="container">
<h1>Electoral Votes Simulator Documentation</h1>
<p>This documentation presents the Electoral Votes Simulator, a Python-based application developed to simulate the voting process in U.S. presidential elections. The application uses a graphical user interface (GUI) created with Tkinter, and it allows users to cast votes, calculate total and electoral votes, and export the results to a CSV file.</p>
<h2>Dependencies</h2>
<ul>
<li>Python 3.x</li>
<li>Tkinter library</li>
<li><code>csv</code> for exporting results</li>
<li><code>random</code> for simulating random outcomes</li>
<li><code>os</code> for managing file paths</li>
<li><code>logging</code> for internal logging of application processes</li>
</ul>
<h2>Application Features</h2>
<p>The Electoral Votes Simulator incorporates several features to enhance user interaction and provide accurate simulations:</p>
<ul>
<li><strong>Custom Input Dialogs:</strong> Utilizes custom dialog classes for gathering user input, ensuring an intuitive user experience.</li>
<li><strong>Voting System:</strong> Simulates a voting system where users can vote for one of two candidates in a mock electoral process.</li>
<li><strong>Result Calculation:</strong> Calculates and displays total votes and electoral votes based on user input and random state outcomes.</li>
<li><strong>Export Functionality:</strong> Allows users to export the final voting and electoral results to a CSV file for record-keeping or further analysis.</li>
</ul>
<h2>Screenshots</h2>
<p>Here are some screenshots of the application:</p>
<img src="https://raw.githubusercontent.com/KernFerm/electoral-vote-simulator/main/screenshots/1ST.png"
alt="Screenshot 1" style="max-width: 100%; margin-bottom: 20px;">
<img src="https://raw.githubusercontent.com/KernFerm/electoral-vote-simulator/main/screenshots/2ND.png"
alt="Screenshot 2" style="max-width: 100%; margin-bottom: 20px;">
<img src="https://raw.githubusercontent.com/KernFerm/electoral-vote-simulator/main/screenshots/3RD.png"
alt="Screenshot 3" style="max-width: 100%; margin-bottom: 20px;">
<img src="https://raw.githubusercontent.com/KernFerm/electoral-vote-simulator/main/screenshots/4TH.png"
alt="Screenshot 4" style="max-width: 100%; margin-bottom: 20px;">
<img src="https://raw.githubusercontent.com/KernFerm/electoral-vote-simulator/main/screenshots/5TH.png"
alt="Screenshot 5" style="max-width: 100%; margin-bottom: 20px;">
<img src="https://raw.githubusercontent.com/KernFerm/electoral-vote-simulator/main/screenshots/6TH.png"
alt="Screenshot 6" style="max-width: 100%; margin-bottom: 20px;">
<img src="https://raw.githubusercontent.com/KernFerm/electoral-vote-simulator/main/screenshots/7TH.png"
alt="Screenshot 7" style="max-width: 100%; margin-bottom: 20px;">
<img src="https://raw.githubusercontent.com/KernFerm/electoral-vote-simulator/main/screenshots/8TH.png"
alt="Screenshot 8" style="max-width: 100%; margin-bottom: 20px;">
<img src="https://raw.githubusercontent.com/KernFerm/electoral-vote-simulator/main/screenshots/9TH.png"
alt="Screenshot 9" style="max-width: 100%; margin-bottom: 20px;">
<img src="https://raw.githubusercontent.com/KernFerm/electoral-vote-simulator/main/screenshots/10TH.png"
alt="Screenshot 10" style="max-width: 100%; margin-bottom: 20px;">
<img src="https://raw.githubusercontent.com/KernFerm/electoral-vote-simulator/main/screenshots/11TH.png"
alt="Screenshot 11" style="max-width: 100%; margin-bottom: 20px;">
<img src="https://raw.githubusercontent.com/KernFerm/electoral-vote-simulator/main/screenshots/12TH.png"
alt="Screenshot 12" style="max-width: 100%; margin-bottom: 20px;">
<img src="https://raw.githubusercontent.com/KernFerm/electoral-vote-simulator/main/screenshots/13TH.png"
alt="Screenshot 13" style="max-width: 100%; margin-bottom: 20px;">
<img src="https://raw.githubusercontent.com/KernFerm/electoral-vote-simulator/main/screenshots/14TH.png"
alt="Screenshot 14" style="max-width: 100%; margin-bottom: 20px;">
<img src="https://raw.githubusercontent.com/KernFerm/electoral-vote-simulator/main/screenshots/15TH.png"
alt="Screenshot 15" style="max-width: 100%; margin-bottom: 20px;">
<h2>Code Overview</h2>
<p>The main components of the application are detailed below:</p>
<ul>
<li><strong>CustomDialog:</strong> A subclass of <code>simpledialog.Dialog</code> tailored to enhance the size and usability of input boxes.</li>
<li><strong>VoteDialog:</strong> A specialized dialog for casting votes, providing a straightforward and error-free voting process.</li>
<li><strong>Logging Configuration:</strong> Set up to log key actions within the application, aiding in debugging and user interaction tracking.</li>
<li><strong>Electoral College Simulation:</strong> A function that simulates the electoral college vote distribution based on random outcomes in each state.</li>
</ul>
<h2>Usage</h2>
<p>To run the simulator, execute the main Python script. The GUI will prompt the user through the voting process, with options to start the simulation, cast votes, and export results. Logging provides a detailed report of each step in the console.</p>
<h2>Conclusion</h2>
<p>The Electoral Votes Simulator serves as an educational tool to understand the complexity of U.S. elections and provides a hands-on approach to learning about the electoral process. It demonstrates the application of GUI programming in Python and practical use of data handling and user input validation.</p>
</div>
<footer>
<p>Written by Bubbles The Dev</p>
<p>For videogame fan aka jpb1991</p>
<p>I hope you get the job! 😊</p>
</footer>
</body>
</html>