I am trying to refresh the Label Image after every 1s I have created one class in which only one time I 'll click on the button to display the image and after that, it will refresh after every second but unable to make that work
Earlier I was trying to make it work with canvas but it wasn't helping me out by showing it through label but was able to refresh using
Code for is mentioned below:
Earlier I was trying to make it work with canvas but it wasn't helping me out by showing it through label but was able to refresh using
self.canvas.after(100, self.loopCap)but now in a label widget, I am not able to understand how refreshing the label every time
Code for is mentioned below:
class PageTwo(tk.Frame): def loopCap(self): # self.label = Label(self.master, image=self.img, textvariable=self.text) self.img = Image.open("img.jpg") self.label = ImageTk.PhotoImage(self.img) tk.Label(self, image=self.label).pack() print("updated") def __init__(self, master): tk.Frame.__init__(self, master,bg='powder blue') self.master.geometry('1350x750+0+0') self.master.config(bg='powder blue') tk.Button(self, text="Return to start page", command=self.loopCap).pack() print("Load")Suggestions will be much appreciated