-
Notifications
You must be signed in to change notification settings - Fork 41
/
admFunc.py
66 lines (47 loc) · 2.71 KB
/
admFunc.py
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
import tkinter as tk
import dframe as df
from tkinter import *
from dframe import *
from PIL import ImageTk,Image
def resetAll(root,frame1):
#df.count_reset()
#df.reset_voter_list()
#df.reset_cand_list()
Label(frame1, text="").grid(row = 10,column = 0)
msg = Message(frame1, text="Reset Complete", width=500)
msg.grid(row = 11, column = 0, columnspan = 5)
def showVotes(root,frame1):
result = df.show_result()
root.title("Votes")
for widget in frame1.winfo_children():
widget.destroy()
Label(frame1, text="Vote Count", font=('Helvetica', 18, 'bold')).grid(row = 0, column = 1, rowspan=1)
Label(frame1, text="").grid(row = 1,column = 0)
vote = StringVar(frame1,"-1")
bjpLogo = ImageTk.PhotoImage((Image.open("img/bjp.png")).resize((35,35),Image.LANCZOS))
bjpImg = Label(frame1, image=bjpLogo).grid(row = 2,column = 0)
congLogo = ImageTk.PhotoImage((Image.open("img/cong.jpg")).resize((25,38),Image.LANCZOS))
congImg = Label(frame1, image=congLogo).grid(row = 3,column = 0)
aapLogo = ImageTk.PhotoImage((Image.open("img/aap.png")).resize((45,30),Image.LANCZOS))
aapImg = Label(frame1, image=aapLogo).grid(row = 4,column = 0)
ssLogo = ImageTk.PhotoImage((Image.open("img/ss.png")).resize((40,35),Image.LANCZOS))
ssImg = Label(frame1, image=ssLogo).grid(row = 5,column = 0)
notaLogo = ImageTk.PhotoImage((Image.open("img/nota.jpg")).resize((35,25),Image.LANCZOS))
notaImg = Label(frame1, image=notaLogo).grid(row = 6,column = 0)
Label(frame1, text="BJP : ", font=('Helvetica', 12, 'bold')).grid(row = 2, column = 1)
Label(frame1, text=result['bjp'], font=('Helvetica', 12, 'bold')).grid(row = 2, column = 2)
Label(frame1, text=" Cong : ", font=('Helvetica', 12, 'bold')).grid(row = 3, column = 1)
Label(frame1, text=result['cong'], font=('Helvetica', 12, 'bold')).grid(row = 3, column = 2)
Label(frame1, text=" AAP : ", font=('Helvetica', 12, 'bold')).grid(row = 4, column = 1)
Label(frame1, text=result['aap'], font=('Helvetica', 12, 'bold')).grid(row = 4, column = 2)
Label(frame1, text=" Shiv Sena : ", font=('Helvetica', 12, 'bold')).grid(row = 5, column = 1)
Label(frame1, text=result['ss'], font=('Helvetica', 12, 'bold')).grid(row = 5, column = 2)
Label(frame1, text=" NOTA : ", font=('Helvetica', 12, 'bold')).grid(row = 6, column = 1)
Label(frame1, text=result['nota'], font=('Helvetica', 12, 'bold')).grid(row = 6, column = 2)
frame1.pack()
root.mainloop()
# if __name__ == "__main__":
# root = Tk()
# root.geometry('500x500')
# frame1 = Frame(root)
# showVotes(root,frame1)