There is my terrible code and there is a loop, the result of which must be constantly updated in tkinter.Label . Experience in programming is not enough, I can not understand the classes and areas of visibility.
In general, the bottom line is that a label created inside create_widgets() must be updated from the result of a for _ in range(30) loop. Functions inside start_reading() are used only there, so it seemed to me an acceptable idea to put functions inside another function (method?). I found this question , but it did not really help me, unfortunately.
Now I'm specifically confused and ask for help. How to fix the code to fix the problem?
import tkinter as tk class Application(tk.Frame): def __init__(self, master=None): super().__init__(master) self.create_widgets() def create_widgets(self): ... # Здесь должен быть лейбл def get_resolution(self, handle, client=True): ... def configuration(self): ... def start_reading(self, arg): a = ... b = ... def get_area(self, resolution, area, foo=None): ... spam = get_area(...) eggs = get_area(...) def get_hash(self, img): ... for _ in range(30): # Лейбл должен изменятся каждый раз ... # при изменении result, т.е. 30 раз result = ... del a # После цикла должны быть удалены a и b. del b # Только там не переменные на самом деле, а # .DeleteDC, .ReleaseDC и подобная ересь if __name__ == '__main__': root = tk.Tk() app = Application(master=root) app.configuration() app.mainloop()