i want to make the labels for the current length of the Text in a tkinter Text widget but my code doing last text box so what i have to do?
from tkinter import *
win=Tk()
win.geometry("700x350")
text_all=[]
label_all=[]
for i in range(1,11):
text=Text(win, width=20, height=1, font=('Calibri 14'))
text.grid(row=i-1,column=0)
text_all.append(text)
label=Label(win, text="Total Characters", justify=CENTER, font=('11'))
label.grid(row=i-1, column=1)
label_all.append(label)
for i in range(1,11):
def update(event):
label_all[i-1].config(text="Total Characters: "+str(len(text_all[i-1].get("1.0", 'end-1c'))))
text_all[i-1].bind('<KeyPress>', update)
text_all[i-1].bind('<KeyRelease>', update)
win.mainloop()