top of page

Simple Tkinter Program That Calculates How Much You Should Save For Bills

  • Writer: Brian Clark
    Brian Clark
  • Oct 11, 2021
  • 2 min read

Today I made a simple program that calculates how much you should save for bills. Many times you don't know how much you should put aside as you earn money. This program allows you to learn how much you should save daily.


The code below is for Tkinter, which is a simple GUI that many people are familiar with.




'''
Author: Brian Clark 
Website: https://brianclark88.wixsite.com/mysite
Description: This simple program calculates how much to save before a bill is due. 

'''

from tkinter import *


window = Tk()

window.title("FundsDueV2.0")
window.geometry('525x425') # Default window size

'''___________TEXT LABELS______________'''

lbl = Label(window, text="What Are The Number Of Bills You Have To Pay?: ",
            font=("Arial Bold", 10))
lbl.grid(column=0, row=0)


lbl_2 = Label(window, text="Enter The Total Bill Amount In Dollars  No Cents: ",
            font=("Arial Bold", 10))
lbl_2.grid(column=0, row=1)

lbl_3 = Label(window, text="How Many Days Do You Have Left To Pay:? ",
              font=("Arial Bold", 10))
lbl_3.grid(column=0, row=2)

lbl_4 = Label(window, text="You Must Save The Following Amount Per Day:  ",
              font=("Arial Bold", 10))
lbl_4.grid(column=0, row=3)


''' ___________INPUT FIELD______________'''

txt = Entry(window, width=10)
txt.grid(column=1, row=0)

txt_2 = Entry(window, width=10)
txt_2.grid(column=1, row=1)

txt_3 = Entry(window, width=10)
txt_3.grid(column=1, row=2)


txt_4= Entry(window, width=10)
txt_4.grid(column=1, row=3)

''' ___________ FUNCTIONS ________________'''
def clicked():

    res =  txt_2.get()

    lbl_2.configure(text=res)
  

def addNums():
  


    first = int(txt.get())
    second = int(txt_2.get())
    third =  int(txt_3.get())
    answer = second / third
    txt_4.insert(0,str(answer))

'''_____________ BUTTONS __________________'''

btn = Button(window, text="=", 
        font=("Arial Bold", 15),bg="darkgrey", fg="blue", command=addNums, height=1, width=23)
btn.grid(column=0, row=5)

'''_____________ COMBO BOX ________________'''



txt_2.focus()
window.mainloop()

The code below is the simple version: 
'''___ FUNDS DUE VERSION 1.3___

Version 2.0 Will include the following: 

         
        3. Make a GUI and exe for it. 

'''
#data = {"01-04-2022": 212.99}

#print(data)
 

 

lst = []

num = int(input('How many bills do you have to pay soon? :\n '))
for n in range(num):
    numbers = int(input('Enter amount in dollars only:  \n'))
    lst.append(numbers)

print("your bill total is :\n", sum(lst), " \n")

Days_left = int(input("How Many Days Do You Have Left To Pay:? \n"))

Bills_added = sum(lst) / Days_left

print("You must save $ ", Bills_added," Per day until your bill is due \n")

input('Press ENTER to exit')

'''
user_input = input("Enter your name: \n") 

message = "Hello %s" % user_input

print(message, " \n")

bill_name = str(input("Name of the bills that you have due "))
#bills_to_pay = input("How Many Bills Do You Have To Pay This Month "+ user_input + "? \n " )


Total = Carnote+Emergency_Savings

Days_left = int(input("How many days are left to pay your bills?: \n"))

Count_days_left = Total / Days_left

print("Make At Least ", Count_days_left , "to pay your bills ")

input('Press ENTER to exit')
'''





 
 
 

Comments


bottom of page