#Índice de Payout = Dividendos Pagos/Lucro Líquido*100
from tkinter import *
root = Tk()
root.geometry("550x400")
root.resizable(0, 0)
root.config(bg="#1d8269")
root.title("Índice de Payout")
titulo = Label(text="Índice de Payout",
font=("Arial", "47", "bold"),bg="#1d8269",fg="#8ff2ef")
titulo.place(relx=0.05, rely=0.05)
texto_sub1 = Label(text="Dividendos Pagos:",
font=("Arial", "18", "bold"),bg="#1d8269",fg="#8ff2ef")
texto_sub1.place(relx=0.15, rely=0.25)
texto_sub2 = Label(text="Lucro Líquido:",
font=("Arial", "18", "bold"),bg="#1d8269",fg="#8ff2ef")
texto_sub2.place(relx=0.2, rely=0.45)
Dividendos_Pagos = DoubleVar()
Dividendos_Pagos_entrada = Entry(textvariable=Dividendos_Pagos,
font=("Arial", "12", "bold"),
bg="white", fg="blue", justify='center')
Dividendos_Pagos_entrada.place(relx=0.58, rely=0.26, relwidth=0.35)
Lucro_Líquido = DoubleVar()
Lucro_Líquido_entrada = Entry(textvariable=Lucro_Líquido,
font=("Arial", "12", "bold"),
bg="white", fg="blue", justify='center')
Lucro_Líquido_entrada.place(relx=0.58, rely=0.46, relwidth=0.35)
def limpar():
Lucro_Líquido_entrada.delete(0, END)
Dividendos_Pagos_entrada.delete(0, END)
def app():
dividendo=Dividendos_Pagos.get()
lucro=Lucro_Líquido.get()
Índice_Payout = (dividendo/lucro)*100
if Índice_Payout<50:
mensagem = f"Índice de Payout: {round(Índice_Payout,2)}\n" \
f"Classificação: Baixo Índice de Payout\n" \
f"A empresa está retendo a maior parte de seus\n" \
f"lucros para reinvestir no crescimento futuro."
elif Índice_Payout> 75:
mensagem = f"Índice de Payout: {round(Índice_Payout, 2)}\n " \
f"Classificação: Alto Índice de Payout\n" \
f"A empresa está priorizando o pagamento de dividendos,\n" \
f"o que pode ser atraente para investidores que buscam renda"
else:
mensagem = f"Índice de Payout: {round(Índice_Payout, 2)}\n " \
f"Classificação: Índice de Payout Moderado\n" \
f"A empresa está equilibrando a distribuição de dividendos\n" \
f"com a retenção de capital para investimentos futuros. "
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.72, relwidth=0.9,relheight=0.25)
root.mainloop()