-
Notifications
You must be signed in to change notification settings - Fork 0
/
test tkinter.py
37 lines (37 loc) · 1.17 KB
/
test tkinter.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
import tkinter as tk
def student_report():
#finding cutoff
mat=int(e4.get())
phy=int(e5.get())
che=int(e6.get())
cutoff=mat+((phy+che)/2)
cutoff_label.config(text=str(cutoff))
root=tk.Tk()
root.title("Test")
root.geometry("700x500")
tk.Label(root,text="Name").grid(row=0,column=1)
tk.Label(root,text='Class').grid(row=1,column=1)
tk.Label(root,text='Roll no').grid(row=2,column=1)
tk.Label(root,text='SUBJECT').grid(row=4,column=4)
tk.Label(root,text='MARKS').grid(row=4,column=5)
tk.Label(root,text='MATHS').grid(row=6,column=4)
tk.Label(root,text='PHYSICS').grid(row=7,column=4)
tk.Label(root,text='CHEMISTRY').grid(row=8,column=4)
e1=tk.Entry(root)
e2=tk.Entry(root)
e3=tk.Entry(root)
e4=tk.Entry(root)
e5=tk.Entry(root)
e6=tk.Entry(root)
e1.grid(row=0,column=2)
e2.grid(row=1,column=2)
e3.grid(row=2,column=2)
e4.grid(row=6,column=5)
e5.grid(row=7,column=5)
e6.grid(row=8,column=5)
btn=tk.Button(root,text='SUBMIT',bg='pink',command=student_report)
btn.grid(row=9,column=5)
tk.Label(root,text='CUTOFF:',font=('Arial',10)).grid(row=10,column=6)
cutoff_label=tk.Label(root,text='')
cutoff_label.grid(row=10,column=7)
root.mainloop()