class StartPage(tk.Frame):
def __init__(self, parent, controller):
tk.Frame.__init__(self, parent)
self.controller = controller
tk.Label(self, text='EPL Predictions').grid(row=0)
NG = tk.Button(self, text='New Game',width = 15, command=lambda: controller.show_frame(SecondPage))
NG.grid(row=1)
Upcoming = tk.Button(self, text='Upcoming Fixtures', width = 15, command=lambda: controller.show_frame(FirstPage))
Upcoming.grid(row=2)
OP = tk.Button(self, text='Odds Progression', width = 15, command=lambda: controller.show_frame(FourthPage))
OP.grid(row=3)
refresh = tk.Button(self, text='Refresh', width = 15, command=lambda: self.refresh_data())
refresh.grid(row=4)
def update_time(self,time_elapsed):
//code to insert time elapsed to temporary Label
def refresh_data(self):
check_time = time.time()
for i in range(10):
time_elapsed = time.time()-check_time
self.update_time(time_elapsed)
//rest of the code to refresh data
So this is part of the code. What I am hoping to achieve is updating a label while the for loop under refresh_data is running (to show the progress of the function).
Right now the label only updates after the for loop is executed.