I want to do what is in the image, but I couldn't do the sum of the listbox, but I don't know how to do it, I'm stuck, any advice?
The truth is I don't know what to do with the code anymore, I've searched for information but I can't find what I'm looking for; I wanted to know if you could give me some advice to add the power to add the listbox to obtain the result.
I'm stuck here and I can't finish, could you give me some advice to improve the code and get the sum.
The code did it in vscode
ferr = tkinter.Tk()
ferr.title("Ferreteria")
var = tkinter.StringVar
#Titulo y tamaño
titulo = tkinter.Label(ferr, text="Ferretería el tronillo feliz",font=("tamaño" ,30, 'bold'))
titulo.grid(row=0,column=0)
#Funcion para ingresar el producto
productos = tkinter.Label(ferr, text="Ingresar Productos",font= ("tamaño",10))
productos.grid(row=1, column=0)
texto1 = tkinter.Entry(ferr, width =80)
texto1.grid(row=3, column=0)
herramientas = tkinter.Listbox(ferr,width=80)
herramientas.grid(row=4,column=0)
#Funcion para ingresar el dinero
precio = tkinter.Label(ferr, text="Ingresar Precio",font= ("tamaño",10))
precio.grid(row=1, column=1)
dinero = tkinter.Entry(ferr, width =20)
dinero.grid(row=3, column=1)
precio2 = tkinter.Listbox(ferr,width=20)
precio2.grid(row=4,column=1)
# Creando la funcion de insert
def insert():
tabla = texto1.get()
herramientas.insert(tkinter.END,tabla)
monto = dinero.get()
precio2.insert(tkinter.END,monto)
#Boton de ingreso de datos
button1 = tkinter.Button(ferr, text= "Agregar", padx=12, command=insert )
button1.grid(row=3,column=2)
#Creando el subtototal
def fnsub():
global numero3
numero1 = dinero.get()
numero2 = float(numero1) + float (numero1)
numero3 = numero2
subtotal1.insert(0,numero3)
subtotal = tkinter.Checkbutton(ferr,text= "Subtotal: ",onvalue= 1, offvalue=0,command=fnsub)
subtotal.grid(row=6,column=1)
subtotal1 = tkinter.Listbox(ferr,width=10,height=1, )
subtotal1.grid(row=6, column=1)
# Creando la factura
def fnfac():
global num3
num2 = float(0.18)
num3 = float(num2)* float(numero3)
factura2.insert(tkinter.END,num3)
factura1 = tkinter.Checkbutton(ferr,text= "Factura: ",onvalue= 1, offvalue=0,command=fnfac)
factura1.grid(row= 7 ,column=1)
factura2 = tkinter.Listbox(ferr,width=10,height=1 )
factura2.grid(row=7, column=1)
#creando el total
def suma():
suma=float(num3)+float(numero3)
total2.insert(tkinter.END,suma)
total1 = tkinter.Checkbutton(ferr,text= "Total: ",onvalue= 1, offvalue=0,command=suma)
total1.grid(row=8,column=1)
total2 = tkinter.Listbox(ferr,width=10,height=1 )
total2.grid(row=8, column=1)
ferr.mainloop()