Razão de Eficiência Operacional

from tkinter import *
root = Tk()
root.geometry("400x400")
root.resizable(0, 0)
root.config(bg="#295369")
root.title("Razão de Eficiência Operacional")
titulo = Label(text="Razão de Eficiência Operacional",
font=("Arial", "18", "bold"),bg="#295369",fg="#8ccced")
titulo.place(relx=0.05, rely=0.05)
texto_sub1 = Label(text="Despesas Operacionais:",
font=("Arial", "14", "bold"),bg="#295369",fg="#8ccced")
texto_sub1.place(relx=0.05, rely=0.25)

texto_sub2 = Label(text="Receita Total:",
font=("Arial", "14", "bold"),bg="#295369",fg="#8ccced")
texto_sub2.place(relx=0.29, rely=0.4)

Despesas_Operacionais = DoubleVar()
Despesas_Operacionais_entrada = Entry(textvariable=Despesas_Operacionais,
font=("Arial", "12", "bold"),
bg="white", fg="blue", justify='center')
Despesas_Operacionais_entrada.place(relx=0.65, rely=0.25, relwidth=0.3)

Receita_Total = DoubleVar()
Receita_Total_entrada = Entry(textvariable=Receita_Total,
font=("Arial", "12", "bold"),
bg="white", fg="blue", justify='center')
Receita_Total_entrada.place(relx=0.65, rely=0.4, relwidth=0.3)
def limpar():
Receita_Total_entrada.delete(0, END)
Despesas_Operacionais_entrada.delete(0, END)
def app():
rt = Receita_Total.get()
do = Despesas_Operacionais.get()
Razão_Eficiência_Operacional =(do/rt)*100
mensagem = f"Razão Eficiência Operacional: {round(Razão_Eficiência_Operacional,2)}"
resultado.set(mensagem)


but1 = Button(text="Calcular", bd=2, bg='#107db2', fg='white',
font=('verdana', 12, 'bold'), command=app)
but1.place(relx=0.05, rely=0.55, relwidth=0.25, relheight=0.1)
but_limpar = Button(text="Limpar", bd=2, bg='#107db2', fg='white',
font=('verdana', 12, 'bold'), command=limpar)
but_limpar.place(relx=0.35, rely=0.55, relwidth=0.25, relheight=0.1)

but_sair = Button(text="Sair", bd=2, bg='#107db2', fg='white',
font=('verdana', 12, 'bold'), command=root.destroy)
but_sair.place(relx=0.65, rely=0.55, relwidth=0.25, relheight=0.1)

resultado = StringVar()
resultado_texto = Label(textvariable=resultado,
font=("Arial", 12, "bold"), bg="#cfe2f3")
resultado_texto.place(relx=0.05, rely=0.7, relwidth=0.9,relheight=0.25)
root.mainloop()

Comentários

Mensagens populares deste blogue

Criar Cartões de Visita

12 signos egípcios

Calcular a percentagem de ocupação