Code:
from tkinter import * window = Tk() window.title('Test') window.geometry('500x500') window.resizable(0, 0) def playclick(): label['text'] = 'Работаем..' def stopclick(): label['text'] = 'Остановлено' button1 = Button(window, text="Старт", width=8, height=2, bg="white", fg="green", font="arial 14", command=playclick) button1.place(x=5, y=5) button2 = Button(window, text="Стоп", width=8, height=2, bg="white", fg="green", font="arial 14", command=stopclick) button2.place(x=120, y=5) label = Label(window, text='Остановлено') label.place(x=5, y=473) text = Text(window, height=24,width=69, font="arial 10",wrap=WORD) text.place(x=5, y=80) data = "temp" #здесь мы будем выводить лог text.insert(1.0,data) # Добавляем скролл scrollbar = Scrollbar(window) scrollbar.pack(side='right') scrollbar['command'] = text.yview() # первая привязка text['yscrollcommand'] = scrollbar.set # вторая привязка window.mainloop() Principle of operation: press the Start button, a cycle is started, in which the text in data changes and this text is displayed in the text field. The cycle lasts until the Stop button is pressed. How to organize it?