Rentibilidade do Investimento

from tkinter import *
root = Tk()
root.geometry("350x350")
root.resizable(0, 0)
root.config(bg="#d9ead3")
root.title("ROI")
def app():
r = Rentibilidade.get()
i = Investimento.get()
a = (r-i)
roi =(a/i)*100
resultado.set(roi)
def limpar():
Investimento_entrada.delete(0, END)
Rentibilidade_entrada.delete(0, END)


titulo = Label(text="Rentibilidade do Investimento",
font=("Arial", "15", "bold"),bg="#d9ead3",fg="#bf9000")
titulo.place(relx=0.1, rely=0.05)

texto_sub1 = Label(text="Rentibilidade",
font=("Arial", "12", "bold"),bg="#d9ead3",fg="#bf9000")
texto_sub1.place(relx=0.13, rely=0.25)
texto_sub2 = Label(text="Investimento",
font=("Arial", "12", "bold"),bg="#d9ead3",fg="#bf9000")
texto_sub2.place(relx=0.13, rely=0.45)
texto_sub3 = Label(text="ROI",
font=("Arial", "12", "bold"),bg="#d9ead3",fg="#bf9000")
texto_sub3.place(relx=0.3, rely=0.8)
Rentibilidade = DoubleVar()
Rentibilidade_entrada = Entry(textvariable=Rentibilidade,
font=("Arial", "12", "bold"),
bg="white", fg="blue", justify='center')
Rentibilidade_entrada.place(relx=0.5, rely=0.25, relwidth=0.4)

Investimento = DoubleVar()
Investimento_entrada = Entry(textvariable=Investimento,
font=("Arial", "12", "bold"),
bg="white", fg="blue", justify='center')
Investimento_entrada.place(relx=0.5, rely=0.45, relwidth=0.4)

#,command=app
butao_mostrar = Button(root, text="Calcular", bg="#466a8d",
font=("Arial","12","bold"),fg="white", command=app)
butao_mostrar.place(relx=0.1,rely=0.6,relwidth=0.25)
butao_limpar = Button(root, text="Limpar", bg="#466a8d",
font=("Arial","12","bold"),fg="white",command=limpar)
butao_limpar.place(relx=0.4,rely=0.6,relwidth=0.25)
butao_exit = Button(root, text="Sair", bg="#466a8d",
font=("Arial","12","bold"),fg="white"
,command=root.destroy)
butao_exit.place(relx=0.7,rely=0.6,relwidth=0.25)

resultado = StringVar()
vresultado = Label(textvariable=resultado,font=("Arial",12,"bold"),
bg="#c0ccc0",fg="green")
vresultado.place(relx=0.55,rely=0.8,relwidth=0.3)
root.mainloop()

Comentários

Mensagens populares deste blogue

Criar Cartões de Visita

12 signos egípcios

Calcular a percentagem de ocupação