-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathIndex_GUI.py
More file actions
84 lines (68 loc) · 3.17 KB
/
Index_GUI.py
File metadata and controls
84 lines (68 loc) · 3.17 KB
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
from tkinter import *
from tkinter.font import Font
import test_database as td
import Data_Graph as dg
import data_visual as dv
def main():
#list Defaulter command
def output_database():
try:
op.delete(0,END)
op.insert(END, 'Defaulter')
for i in td.td1():
op.insert(END, i)
except Exception:
op.delete(0,END)
op.insert(END, "Could not Establish the connection")
op.itemconfig(0 , {'fg' : 'red'})
def clear_text():
op.delete(0,END)
def all_data():
try:
op.delete(0,END)
op.insert(END,'Name Attendance Subject Subject_Code')
for i in td.td2():
op.insert(END, i)
dg.data()
except Exception:
op.delete(0,END)
op.insert(END, 'Could not Establish the connection:')
op.itemconfig(0 , {'fg' : 'red'})
def inp_text():
x = text_entry.get()
dv.data_vis1(x)
window = Tk()
text_input = StringVar()
searc = PhotoImage(file = r'C:\Users\aaris\Downloads\Data-Visualization-Using-Matplotlib-master\search.png')
search = searc.subsample(20, 20)
clea = PhotoImage(file = r'C:\Users\aaris\Downloads\Data-Visualization-Using-Matplotlib-master\clear.png')
clear = clea.subsample(20, 20)
sho = PhotoImage(file = r'C:\Users\aaris\Downloads\Data-Visualization-Using-Matplotlib-master\find.png')
show = sho.subsample(20, 20)
ques = PhotoImage(file = r'C:\Users\aaris\Downloads\Data-Visualization-Using-Matplotlib-master\question.png')
quest = ques.subsample(20, 20)
text_entry = Entry(window, textvariable = 'text_input', border= 1,font = (20))
window.title('Attendance Management System')#Ploting the titlte
window.iconbitmap(r'C:\Users\aaris\Downloads\Data-Visualization-Using-Matplotlib-master\favicon.ico')
label = Label(window,text= 'Welcome To Attendance Management System',font = ('bold',16))#ploting the label
btn = Button(window, text = 'Defaulters',command = output_database, image = quest, compound = LEFT, relief = GROOVE, border = 1 )
btn2 = Button(window, text = 'Search', command = inp_text, image = search, compound = LEFT, relief = GROOVE, border = 1)
btn3 = Button(window, text = 'Show All',command = all_data, image = show, compound = LEFT, relief = GROOVE, border = 1)
op = Listbox(window, height = 10, width = 100, border = 0)
scroll = Scrollbar(window)
#scroll option or scroll config
op.configure(yscrollcommand = scroll.set)
scroll.configure(command = op.yview)
clr_btn = Button(window, text = 'CLear', command = clear_text, image = clear, compound = LEFT, relief = GROOVE, border = 1 )
label.pack()
btn.place(x = 30, y = 50 )
btn2.place(x = 260, y = 150)
btn3.place(x = 30, y = 100)
text_entry.place(x = 30, y = 150, height = 30, width = 200)
op.place(x = 30, y = 190)
scroll.place(x = 630,y = 190, height = 160)
clr_btn.place(x = 630, y = 360)
window.geometry('720x480')
window.mainloop()
if __name__ == "__main__":
main()