Mundo em Python

Índice de Giro de Estoque

from tkinter import *
root = Tk()
root.geometry("400x400")
root.resizable(0, 0)
root.config(bg="#114dcf")
root.title("Índice de Giro de Estoque")
def limpar():
Produtos_Vendidos_entrada.delete(0, END)
Valor_Estoque_entrada.delete(0, END)
resultado.set("")
def app():
produtos_vendidos = Produtos_Vendidos.get()
valor_estoque = Valor_Estoque.get()
indice= produtos_vendidos/valor_estoque
resultado.set(indice) titulo = Label(text="Índice de Giro de Estoque",
font=("Arial", "22", "bold"),bg="#114dcf",fg="#d5dbe8")
titulo.place(relx=0.05, rely=0.05)
texto_sub1 = Label(text="Custo dos Produtos Vendidos :",
font=("Arial", "12", "bold"),bg="#114dcf",fg="#d5dbe8")
texto_sub1.place(relx=0.04, rely=0.3) texto_sub1 = Label(text="Média do Valor do Estoque :",
font=("Arial", "12", "bold"),bg="#114dcf",fg="#d5dbe8")
texto_sub1.place(relx=0.08, rely=0.45) Produtos_Vendidos = DoubleVar()
Produtos_Vendidos_entrada = Entry(textvariable=Produtos_Vendidos,
font=("Arial", "12", "bold"),
bg="white", fg="blue", justify='center')
Produtos_Vendidos_entrada.place(relx=0.68, rely=0.3, relwidth=0.3) Valor_Estoque = DoubleVar()
Valor_Estoque_entrada = Entry(textvariable=Valor_Estoque,
font=("Arial", "12", "bold"),
bg="white", fg="blue", justify='center')
Valor_Estoque_entrada.place(relx=0.68, rely=0.45, relwidth=0.3) #
but1 = Button(text="Verificar", bd=2, bg='#107db2', fg='white',
font=('verdana', 12, 'bold'), command=app)
but1.place(relx=0.05, rely=0.6, 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.6, 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.6, 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.8, relwidth=0.9,relheight=0.1) root.mainloop()
0