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

Income Tax Calculator #752

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
prathimacode-hub merged 40 commits into prathimacode-hub:main from baljeetsingh99:main
Jul 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
d5bca03
Create tax.py
baljeetsingh99 Jul 14, 2021
046dade
Create README.md
baljeetsingh99 Jul 14, 2021
2bdc520
Create .gitignore
baljeetsingh99 Jul 14, 2021
5f03ced
Update README.md
baljeetsingh99 Jul 14, 2021
c3a2c48
Update README.md
baljeetsingh99 Jul 14, 2021
574aaa9
Create requirements.txt
baljeetsingh99 Jul 14, 2021
1574fab
Update README.md
baljeetsingh99 Jul 14, 2021
8c683e0
Update README.md
baljeetsingh99 Jul 14, 2021
8a1594c
Update requirements.txt
baljeetsingh99 Jul 14, 2021
451d647
Create images
baljeetsingh99 Jul 14, 2021
26c166f
Add files via upload
baljeetsingh99 Jul 14, 2021
50adab1
Update README.md
baljeetsingh99 Jul 14, 2021
a722de6
Update README.md
baljeetsingh99 Jul 14, 2021
0919f56
Update README.md
baljeetsingh99 Jul 14, 2021
a0222a9
Update README.md
baljeetsingh99 Jul 14, 2021
55f9def
Delete images
baljeetsingh99 Jul 14, 2021
4056f7a
Update README.md
baljeetsingh99 Jul 14, 2021
b551f95
Update tax.py
baljeetsingh99 Jul 14, 2021
6a4ea95
Rename GUIScripts/IncomeTaxCal/README.md to GUIScripts/Income Tax Cal...
baljeetsingh99 Jul 14, 2021
47d2b10
Delete GUIScripts/Income Tax Calculator directory
baljeetsingh99 Jul 14, 2021
455f289
Create README.md
baljeetsingh99 Jul 14, 2021
c720262
Create Income Tax Calculator.py
baljeetsingh99 Jul 14, 2021
477fd89
Create requirements.txt
baljeetsingh99 Jul 14, 2021
0f37f02
Create README.md
baljeetsingh99 Jul 14, 2021
5c48835
Create .gitignore
baljeetsingh99 Jul 14, 2021
f6d29c0
Create img.txt
baljeetsingh99 Jul 14, 2021
fab4378
Add files via upload
baljeetsingh99 Jul 14, 2021
925c2a4
Delete GUIScripts/IncomeTaxCal directory
baljeetsingh99 Jul 14, 2021
4a48d6a
Rename Income Tax Calculator.py to income_tax_calculator.py
baljeetsingh99 Jul 14, 2021
baa751e
Delete img.txt
baljeetsingh99 Jul 14, 2021
d0ae10f
Update README.md
baljeetsingh99 Jul 14, 2021
80283c6
Update README.md
baljeetsingh99 Jul 14, 2021
9f6ad9e
Delete .gitignore
baljeetsingh99 Jul 14, 2021
8176b1c
Update README.md
baljeetsingh99 Jul 14, 2021
04c45bc
Create img.txt
baljeetsingh99 Jul 15, 2021
463cb51
Add files via upload
baljeetsingh99 Jul 15, 2021
696d65c
Delete GUIScripts/Income Tax Calculator/images directory
baljeetsingh99 Jul 15, 2021
b6d08d3
Update README.md
baljeetsingh99 Jul 15, 2021
f7a9757
Delete img.txt
baljeetsingh99 Jul 15, 2021
2a4f266
Update README.md
baljeetsingh99 Jul 15, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
View file Open in desktop
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
[フレーム]
49 changes: 49 additions & 0 deletions GUIScripts/Income Tax Calculator/README.md
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#income-Tax-Calculator

## Aim

here is basic GUI based income tax calculator written in python language all
the parameters used here are not correct just on internet search basis just pull
the code and update the creteria of tax and use it anyone can contribute this to upgrade
it or if willingly to make changes just fork it make changes and pull req.

## Purpose

here the default values are used, user can change the values accouding to the current govt. tax deduction creteria.
people can use this app to calculate there tax amount to be paid.
simple and easy to use.

## Short description of package/script

- used tkinter library for giving GUI touch to the script

## Workflow of the Project
- used jupyter notebook for the project
- used tkinter library for gui
- used default values for calculating the tax
- user can type values by clicking on the screen as 1 - 9 digits are added
- added clear button to calculate new data.


## Setup instructions

In order to get started we need to install the following library by using the pip command
pip install tkinter

After installing this library we need to create an app.py file and copy paste the following code
income_tax_calculator.py


## Compilation Steps

here we are using jupyter compiler for the project .
just run the script by clicking on run button.


## Output

<img src="https://github.com/baljeet-singh97/Awesome_Python_Scripts/blob/f7a97575000a32c3d79f934233992f5bf497f4f7/GUIScripts/Income%20Tax%20Calculator/Images/Screenshot%20(836).png" alt="Hello world">

## Author(s)

- [Baljeet Singh](https://www.linkedin.com/in/baljeet-singh97/)
132 changes: 132 additions & 0 deletions GUIScripts/Income Tax Calculator/income_tax_calculator.py
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# import all functions/classes from the tkinter
from tkinter import *
from tkinter import ttk

exp = " "
def press(num):
global exp
exp+=str(num)
equation.set(exp)

# Function for clearing the
# contents of all text entry boxes
def clear ():
global exp
exp = " "
equation.set(" ")

#function to calculate the tax it values are default , could varie from time to time.
def taxamount(income):
totalamount=0
tax=0
if income <= 500000:
tax = 0

elif income <= 1000000:
tax = 12500 + (income) * 0.20

elif income >= 1000001:
tax = 112500 + (income) * 0.30
else:
tax = 12500+100000+(income - 1000000)* 0.3

totalamount=tax
return totalamount

# take a value from the respective entry boxes
# get method returns current text as string
def butter():
income=IntVar()
income=incomefield.get()
entryField.delete(0,'end')
amount = taxamount(int(income))
print(amount)
entry.set(str(amount))


# Create a GUI window
root=Tk()


# Set the background colour of GUI window
root.configure(background="lightgrey")
root.resizable(0,0)

# Set the configuration of GUI window
root.geometry('300x280')

# set the name of tkinter GUI window
root.title("income Tax Calculator")

entry= StringVar()
equation = StringVar()

# *************************************************************************
inputField = Frame(root)
inputField.place(x=20,y=10)

# Create a Original your income: label
labelincome = Label(inputField,text="Your Income",background="royalblue",width=12,foreground="White")
labelincome.grid(row=0, column=0)
incomefield = Entry(inputField,textvariable = equation, width = 20,background="SkyBlue2",foreground="black",justify=CENTER)
incomefield.grid(row=0,column=1)

# Create a Original Total tax: label
totaltax = Label(inputField,text="Total Tax",background="royalblue",width=12,foreground="white")
totaltax.grid(row=1,column=0)
entryField = Entry(inputField,textvariable = entry, width = 20,background="Yellowgreen",foreground="black",justify=CENTER)
entryField.grid(row=1,column=1)

# *************************************************************************
findTaxFrame = Frame(root)
findTaxFrame.place(x=20,y=80)

# Create a Button to click to make the caculation.
button = Button(findTaxFrame,text="Find Income Tax", width = 30,activebackground="cyan",background='skyblue', command=butter)
button.grid(row=2,column=0,columnspan=3)

# *************************************************************************

#Creating the buttons from 1 - 9 and 0 in GUI window to enter the number.
numpadFrame = Frame(root)
numpadFrame.place(x=20,y=120)

btn9 = ttk.Button(numpadFrame, text = '9' , width = 10 , command = lambda : press(9) )
btn9.grid(row=0,column=0)

btn8 = ttk.Button(numpadFrame, text = '8' , width = 10 , command = lambda : press(8) )
btn8.grid(row=0,column=1)

btn7 = ttk.Button(numpadFrame, text = '7' , width = 10 , command = lambda : press(7) )
btn7.grid(row=0,column=2)

btn6 = ttk.Button(numpadFrame, text = '6' , width = 10 , command = lambda : press(6) )
btn6.grid(row=1,column=0)

btn5 = ttk.Button(numpadFrame, text = '5' , width = 10 , command = lambda : press(5) )
btn5.grid(row=1,column=1)

btn4 = ttk.Button(numpadFrame, text = '4' , width = 10 , command = lambda : press(4) )
btn4.grid(row=1,column=2)

btn3 = ttk.Button(numpadFrame, text = '3' , width = 10, command = lambda : press(3) )
btn3.grid(row=2,column=0)

btn2 = ttk.Button(numpadFrame, text = '2' , width = 10, command = lambda : press(2) )
btn2.grid(row=2,column=1)

btn1 = ttk.Button(numpadFrame, text = '1' , width = 10 , command = lambda : press(1) )
btn1.grid(row=2,column=2)

zeroAndClearFrame = Frame(root)
zeroAndClearFrame.place(x=20,y=220)

btn0= ttk.Button(zeroAndClearFrame, text = '0' , width = 10, command = lambda : press(0) )
btn0.grid(row=3,column=0)

#Creating the buttons CLEAR to clear the txt boxes.
btnclr = Button(zeroAndClearFrame, text = 'Clear' , width = 19, background='orange', activebackground='red',activeforeground='white', command = clear )
btnclr.grid(row=3,column=1)

# Start the GUI
root.mainloop()
3 changes: 3 additions & 0 deletions GUIScripts/Income Tax Calculator/requirements.txt
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1. need to be installed any python compiler , prferred use jupyter

2. Importing the module – tkinter

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