Никак не могу понять какой именно индекс здесь нужен.
from tkinter import * window = Tk() window.title("Программирование циклических алгоритмов") window.geometry("650x450") f_ish = Frame(window) f_ish = LabelFrame(text="Исходные данные", font=("Times new Roman",14)) lbl = Label(f_ish, text="Ввод левой границы интервала:", font=("Times new Roman", 14)) lbl.grid(column=0, row=0) txt1 = Entry(f_ish, width=18, font=("Times new Roman", 14)) txt1.grid(column=2, row=0) lbl1 = Label(f_ish, text="Ввод правой границы интервала:", font=("Times new Roman", 14)) lbl1.grid(column=0, row=1) txt2 = Entry(f_ish, width=18, font=("Times new Roman", 14)) txt2.grid(column=2, row=1) lbl2 = Label(f_ish, text="Ввод количества чисел последовательности:", font=("Times new Roman", 14)) lbl2.grid(column=0, row=2) txt3 = Entry(f_ish, width=18, font=("Times new Roman", 14)) txt3.grid(column=2, row=2) lbl3 = Label(f_ish, text="Ввод чисел последовательности:", font=("Times new Roman", 14)) lbl3.grid(column=0, row=4) txt5 = Text(f_ish, width=18, height=10, font=("Times new Roman", 14)) txt5.grid(column=2, row=4) f_res = Frame(window) f_res = LabelFrame(text="Результаты вычислений", font=("Times new Roman", 14)) lbl = Label(f_res, text="Сумма чисел последовательности:", font=("Times new Roman", 14),width=35) lbl.grid(column=0, row=0) txt6 = Entry(f_res, width=18, font=("Times new Roman", 14)) txt6.grid(column=1, row=0) def clicked(): a = int(txt1.get()) b = int(txt2.get()) n = int(txt3.get()) sum = 0 for i in range(1, n + 1): x = float(txt5.get(1.0+i,str(1.0+i)+" line-end")) if x > 0 and (x > b or x < a): sum = sum + x txt6.delete(0,END) txt6.insert(0,sum) def clicked1(): window.destroy() f_but = Frame(window) btn = Button(f_but, text="Расчет", width=25, command=clicked, font=("Times new Roman", 14)) btn.grid(column=0, row=1) btn = Button(f_but, text="Выход", width=25, command=clicked1, font=("Times new Roman", 14)) btn.grid(column=0, row=2) f_ish.pack() f_res.pack() f_but.pack() window.mainloop() /code Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\russt\AppData\Local\Programs\Python\Python39\lib\tkinter\__init__.py", line 1892, in __call__ return self.func(*args) File "C:\Users\russt\PycharmProjects\pythonProject\main.py", line 35, in clicked x = float(txt5.get(1.0+i,str(1.0+i)+" line-end")) File "C:\Users\russt\AppData\Local\Programs\Python\Python39\lib\tkinter\__init__.py", line 3711, in get return self.tk.call(self._w, 'get', index1, index2) _tkinter.TclError: bad text index "2.0 line-end"