'How to create financial calculations in tkinter?

I've been trying to figure out how to create financial ratios within my dropdown menus in python tkinter where u can calculate profitability ratios, liquidity ratios, leverage ratios and operating ratios. This would all be in tab 1. Then in tab 2, I want to create a code to calculate future value and present value investments. Lastly, for tab 3, it should calculate the Net Present Value, Internal Rate of Return (IRR) and Payback Period (PP)according to what a user inputs.

Here is the base code I've done so far but I'm struggling to finish it so that there are financial calculations.

from doctest import master
import tkinter as tk
import tkinter.font as font


def clear_screen():
    for widget in window.winfo_children():
        widget.destroy()
    lbl_tt = tk.Label(text="Enter Amount",foreground="green")
    lbl_tt.grid(row=0,column=1)
    lbl_tt.config(width=20)
    ety_tt = tk.Entry()
    ety_tt.grid(row=1,column=1)


window = tk.Tk()
window.config(bg="#615b5c")
window.geometry("500x500+25+25")
frame_2 = tk.Frame(window,borderwidth=5,background="#696969", relief=tk.RAISED)
frame_3 = tk.Frame(window,borderwidth=5,background="#696969",relief=tk.RAISED)
frame_1 = tk.Frame(window,borderwidth=5,background="#696969",relief=tk.RAISED)

window.columnconfigure(1, weight=1, minsize=75)
window.rowconfigure(0, weight=1, minsize=50)
frame_1.grid(row=0,column=1,padx=3,pady=5)
window.columnconfigure(1, weight=1, minsize=75)
window.rowconfigure(1, weight=1, minsize=50)
 
frame_2.grid(row=1,column=1,padx=3,pady=5)
window.columnconfigure(1, weight=1, minsize=75)
window.rowconfigure(2, weight=1, minsize=50)
frame_3.grid(row=2,column=1,padx=3,pady=5)

myFont = font.Font(family='Helvetica', size=20, weight='bold')

button_1 = tk.Button(master=frame_1,text="TAB-1",width=20,height=5,background="#c4bcbe",font=myFont,command=clear_screen)
button_2 = tk.Button(master=frame_2,text="TAB-2",width=20,height=5,background="#c4bcbe",font=myFont,command=clear_screen)
button_3 = tk.Button(master=frame_3,text="TAB-3",width=20,height=5,background="#c4bcbe",font=myFont,command=clear_screen)



button_1.pack()
button_2.pack()
button_3.pack()


window.mainloop()                            
[02:15]
import tkinter as tk
import tkinter.font as font


def clear_screen():
    for widget in window.winfo_children():
        widget.destroy()
    OPTIONS = [
        "Profitability Ratios",
        "Liquidity Ratios",
        "Leverage Ratios",
        "Operating Ratios"
    ]
    variable = tk.StringVar(window)
    variable.set(OPTIONS[0])  # default value
    frame_a = tk.Frame(window, borderwidth=5, background="#696969", relief=tk.RAISED)
    frame_a.pack()
    w = tk.OptionMenu(frame_a, variable, *OPTIONS)
    w.pack()
    frame_b = tk.Frame(window, borderwidth=5, background="#696969", relief=tk.RAISED)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source