Skip to content

Commit a86f418

Browse files
authored
GST Calculator (avinashkranjan#985)
1 parent bd9f3c2 commit a86f418

File tree

2 files changed

+109
-0
lines changed

2 files changed

+109
-0
lines changed

GST Calculator/Readme.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# <b>GST Calculator</b>
2+
3+
[![forthebadge](https://forthebadge.com/images/badges/made-with-python.svg)](https://forthebadge.com)
4+
5+
## GST Calculator Functionalities : 🚀
6+
7+
- This is a GST Calculator where the user enters the original price and net price and the script returns the GST percentage.
8+
9+
## GST Calculator Instructions: 👨🏻‍💻
10+
11+
### Step 1:
12+
13+
Open Termnial 💻
14+
15+
### Step 2:
16+
17+
Locate to the directory where python file is located 📂
18+
19+
### Step 3:
20+
21+
Run the command: python script.py/python3 script.py 🧐
22+
23+
### Step 4:
24+
25+
Sit back and Relax. Let the Script do the Job. ☕
26+
27+
## Requirements
28+
29+
- tkinter
30+
31+
## DEMO
32+
![Screenshot (241)](https://user-images.githubusercontent.com/60662775/116357999-c86af180-a81a-11eb-91b2-fe1bca70872c.png)
33+
34+
## Author
35+
36+
Amit Kumar Mishra
37+

GST Calculator/script.py

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
from tkinter import *
2+
3+
# Function for finding GST rate
4+
def GST_Calc() :
5+
6+
gst_percentField.delete(0, END)
7+
8+
org_cost= int(original_priceField.get())
9+
10+
N_price = int(net_priceField.get())
11+
12+
gst_rate = ((N_price - org_cost) * 100) / org_cost;
13+
14+
gst_percentField.insert(10, str(gst_rate) + " % ")
15+
16+
def clearAll():
17+
18+
original_priceField.delete(0, END)
19+
20+
net_priceField.delete(0, END)
21+
22+
gst_percentField.delete(0, END)
23+
24+
25+
# Driver Code
26+
if __name__ == "__main__" :
27+
28+
gui = Tk()
29+
30+
gui.configure(background = "light blue")
31+
32+
gui.title("GST Calculator")
33+
34+
gui.geometry("500x500")
35+
36+
original_price = Label(gui, text = "Original Price",
37+
font=(None,18))
38+
39+
original_price.grid(row = 1, column = 1,padx = 10,pady = 10,sticky='w')
40+
41+
original_priceField = Entry(gui)
42+
43+
original_priceField.grid(row = 1, column = 2 ,padx = 10,pady = 10,sticky='w')
44+
45+
46+
net_price = Label(gui, text = "Net Price",
47+
font=(None,18))
48+
49+
net_price.grid(row = 2, column = 1, padx = 10, pady = 10,sticky='w')
50+
net_priceField = Entry(gui)
51+
net_priceField.grid(row = 2, column = 2, padx = 10,pady = 10,sticky='w')
52+
53+
54+
find = Button(gui, text = "Find", fg = "Black",
55+
bg = "light yellow",
56+
command = GST_Calc)
57+
find.grid(row = 3, column = 2,padx = 10,pady = 10,sticky='w')
58+
59+
gst_percent = Label(gui, text = "Gst Rate", font=(None,18))
60+
gst_percent.grid(row = 4, column = 1,padx = 10, pady = 10,sticky='w')
61+
gst_percentField = Entry(gui)
62+
63+
gst_percentField.grid(row = 4, column = 2, padx = 10,pady = 10,sticky='w')
64+
65+
clear = Button(gui, text = "Clear", fg = "Black",
66+
bg = "light yellow",
67+
command = clearAll)
68+
69+
clear.grid(row = 5, column = 2, padx = 10, pady = 10,sticky='w')
70+
71+
# Start the GUI
72+
gui.mainloop()

0 commit comments

Comments
 (0)