Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit dc644fb

Browse files
Merge pull request #688 from rammya29/main
Marksheet - GUI
2 parents 9ff599b + d87af6c commit dc644fb

File tree

5 files changed

+245
-0
lines changed

5 files changed

+245
-0
lines changed
19.8 KB
Loading[フレーム]
21.4 KB
Loading[フレーム]

‎GUIScripts/Marksheet - GUI/README.md‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Marksheet - GUI
2+
3+
## Objective
4+
5+
It is to create a simple marksheet where it reduces the work by calculating the grade with the subject credits and it gives overall grade.
6+
7+
## Library Used
8+
9+
- Tkinter
10+
11+
## Setup
12+
13+
It is easy to setup just download code and go through prerequisites and run it.
14+
15+
## Description
16+
17+
The script is based on python, we have imported the tkinter modules.
18+
19+
The workspace is created using tkinter module for looks like gui application.
20+
21+
Buttons are created and alligned to give a neat outlook.
22+
23+
Functions are created for each operation like grade calculation, SGPA clculation etc.
24+
25+
Then main loop is set to call all function when user click the required button.
26+
27+
## Sample Output
28+
29+
![](https://github.com/rammya29/Awesome_Python_Scripts/blob/main/GUIScripts/Marksheet%20-%20GUI/Images/Image-1.jpg)
30+
31+
![](https://github.com/rammya29/Awesome_Python_Scripts/blob/main/GUIScripts/Marksheet%20-%20GUI/Images/Image-2.jpg)
32+
33+
**AUTHOR** : RAMMYA DHARSHINI K
Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
# Import tkinter as tk
2+
import tkinter as tk
3+
4+
#------------------------------------------------------------------------------------------------------------------------------------------------------
5+
6+
# creating a new tkinter window
7+
root = tk.Tk()
8+
root.title("MARKSHEET") # assigning a title
9+
root.geometry("500x250") # specifying geometry for window size
10+
root.configure(bg='magenta')
11+
12+
#------------------------------------------------------------------------------------------------------------------------------------------------------
13+
14+
# declaring objects for entering data
15+
e1 = tk.Entry(root)
16+
e2 = tk.Entry(root)
17+
e3 = tk.Entry(root)
18+
e4 = tk.Entry(root)
19+
e5 = tk.Entry(root)
20+
e6 = tk.Entry(root)
21+
e7 = tk.Entry(root)
22+
23+
#------------------------------------------------------------------------------------------------------------------------------------------------------
24+
25+
26+
# function to display the total subject
27+
# credits total credits and SGPA according to grades entered
28+
def display():
29+
30+
# Variable to store total marks
31+
tot=0
32+
33+
# 10*number of subject credits
34+
# give total credits for grade A
35+
if e4.get() == "A":
36+
37+
# grid method is used for placing
38+
# the widgets at respective positions
39+
# in table like structure .
40+
tk.Label(root, text ="40" , bg='magenta').grid(row=3, column=4)
41+
tot += 40
42+
43+
# 9*number of subject credits give
44+
# total credits for grade B
45+
if e4.get() == "B":
46+
tk.Label(root, text ="36" , bg='magenta').grid(row=3, column=4)
47+
tot += 36
48+
49+
# 8*number of subject credits give
50+
# total credits for grade C
51+
if e4.get() == "C":
52+
tk.Label(root, text ="32" , bg='magenta').grid(row=3, column=4)
53+
tot += 32
54+
55+
# 7*number of subject credits
56+
# give total credits for grade D
57+
if e4.get() == "D":
58+
tk.Label(root, text ="28" , bg='magenta').grid(row=3, column=4)
59+
tot += 28
60+
61+
# 6*number of subject credits give
62+
# total credits for grade P
63+
if e4.get() == "P":
64+
tk.Label(root, text ="24" , bg='magenta').grid(row=3, column=4)
65+
tot += 24
66+
67+
# 0*number of subject credits give
68+
# total credits for grade F
69+
if e4.get() == "F":
70+
tk.Label(root, text ="0" , bg='magenta').grid(row=3, column=4)
71+
tot += 0
72+
73+
74+
# Similarly doing with other objects
75+
if e5.get() == "A":
76+
tk.Label(root, text ="40" , bg='magenta').grid(row=4, column=4)
77+
tot += 40
78+
if e5.get() == "B":
79+
tk.Label(root, text ="36" , bg='magenta').grid(row=4, column=4)
80+
tot += 36
81+
if e5.get() == "C":
82+
tk.Label(root, text ="32").grid(row=4, column=4)
83+
tot += 32
84+
if e5.get() == "D":
85+
tk.Label(root, text ="28" , bg='magenta').grid(row=4, column=4)
86+
tot += 28
87+
if e5.get() == "P":
88+
tk.Label(root, text ="28" , bg='magenta').grid(row=4, column=4)
89+
tot += 24
90+
if e5.get() == "F":
91+
tk.Label(root, text ="0" , bg='magenta').grid(row=4, column=4)
92+
tot += 0
93+
94+
95+
96+
if e6.get() == "A":
97+
tk.Label(root, text ="30" , bg='magenta').grid(row=5, column=4)
98+
tot += 30
99+
if e6.get() == "B":
100+
tk.Label(root, text ="27" , bg='magenta').grid(row=5, column=4)
101+
tot += 27
102+
if e6.get() == "C":
103+
tk.Label(root, text ="24" , bg='magenta').grid(row=5, column=4)
104+
tot += 24
105+
if e6.get() == "D":
106+
tk.Label(root, text ="21" , bg='magenta').grid(row=5, column=4)
107+
tot += 21
108+
if e6.get() == "P":
109+
tk.Label(root, text ="28" , bg='magenta').grid(row=5, column=4)
110+
tot += 24
111+
if e6.get() == "F":
112+
tk.Label(root, text ="0" , bg='magenta').grid(row=5, column=4)
113+
tot += 0
114+
115+
116+
117+
118+
if e7.get() == "A":
119+
tk.Label(root, text ="40" , bg='magenta').grid(row=6, column=4)
120+
tot += 40
121+
if e7.get() == "B":
122+
tk.Label(root, text ="36" , bg='magenta').grid(row=6, column=4)
123+
tot += 36
124+
if e7.get() == "C":
125+
tk.Label(root, text ="32" , bg='magenta').grid(row=6, column=4)
126+
tot += 32
127+
if e7.get() == "D":
128+
tk.Label(root, text ="28" , bg='magenta').grid(row=6, column=4)
129+
tot += 28
130+
if e7.get() == "P":
131+
tk.Label(root, text ="28" , bg='magenta').grid(row=6, column=4)
132+
tot += 24
133+
if e7.get() == "F":
134+
tk.Label(root, text ="0" , bg='magenta').grid(row=6, column=4)
135+
tot += 0
136+
137+
138+
# to display total credits
139+
tk.Label(root, text=str(tot) , bg='magenta').grid(row=7, column=4)
140+
141+
# to display SGPA
142+
tk.Label(root, text=str(tot/15) , bg='magenta').grid(row=8, column=4)
143+
144+
145+
# end of display function
146+
147+
#------------------------------------------------------------------------------------------------------------------------------------------------------
148+
149+
# label to enter name
150+
tk.Label(root, text="Name" , bg='magenta').grid(row=0, column=0)
151+
152+
# label for registration number
153+
tk.Label(root, text="Reg.No" , bg='magenta').grid(row=0, column=3)
154+
155+
# label for roll Number
156+
tk.Label(root, text="Roll.No" , bg='magenta').grid(row=1, column=0)
157+
158+
# labels for serial numbers
159+
tk.Label(root, text="Srl.No" , bg='magenta').grid(row=2, column=0)
160+
tk.Label(root, text="1" , bg='magenta').grid(row=3, column=0)
161+
tk.Label(root, text="2" , bg='magenta').grid(row=4, column=0)
162+
tk.Label(root, text="3" , bg='magenta').grid(row=5, column=0)
163+
tk.Label(root, text="4" , bg='magenta').grid(row=6, column=0)
164+
165+
#------------------------------------------------------------------------------------------------------------------------------------------------------
166+
167+
168+
tk.Label(root, text="Subject" , bg='magenta').grid(row=2, column=1) # labels for subject codes
169+
tk.Label(root, text="MA 8591" , bg='magenta').grid(row=3, column=1)
170+
tk.Label(root, text="EC 8501" , bg='magenta').grid(row=4, column=1)
171+
tk.Label(root, text="EC 8591" , bg='magenta').grid(row=5, column=1)
172+
tk.Label(root, text="CS 8512" , bg='magenta').grid(row=6, column=1)
173+
174+
175+
176+
tk.Label(root, text="Grade" , bg='magenta').grid(row=2, column=2) # label for grades
177+
e4.grid(row=3, column=2)
178+
e5.grid(row=4, column=2)
179+
e6.grid(row=5, column=2)
180+
e7.grid(row=6, column=2)
181+
182+
183+
184+
tk.Label(root, text="Sub Credit" , bg='magenta').grid(row=2, column=3) # labels for subject credits
185+
tk.Label(root, text="4" , bg='magenta').grid(row=3, column=3)
186+
tk.Label(root, text="4" , bg='magenta').grid(row=4, column=3)
187+
tk.Label(root, text="3" , bg='magenta').grid(row=5, column=3)
188+
tk.Label(root, text="4" , bg='magenta').grid(row=6, column=3)
189+
190+
tk.Label(root, text="Credit obtained" , bg='magenta').grid(row=2, column=4)
191+
192+
193+
e1=tk.Entry(root) # taking entries of name, reg, roll number respectively
194+
e2=tk.Entry(root)
195+
e3=tk.Entry(root)
196+
197+
e1.grid(row=0, column=1) # organizing them in th e grid
198+
e2.grid(row=0, column=4)
199+
e3.grid(row=1, column=1)
200+
201+
202+
button1=tk.Button(root, text="submit", bg="green", command=display) # button to display all the calculated credit scores and sgpa
203+
button1.grid(row=8, column=1)
204+
205+
tk.Label(root, text="Total credit", bg='magenta').grid(row=7, column=3)
206+
tk.Label(root, text="SGPA" , bg='magenta').grid(row=8, column=3)
207+
208+
root.mainloop()
209+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
1. Tkinter Module
2+
3+
Already installed with the pakage (if not look into pypi.org)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /