I have a GUI program such that when a button is pressed, a label should be shown that indicates some processed has started, and the process should then start. I placed all of that inside a function that gets called when the button is pressed. This causes the label to not show up right away. I think this is because the Tkinter window works in loops and the whole function must finish executing before any change is reflected in the window, is that correct? What is a good way around this?
import time
from tkinter import *
def function1():
myLabel = Label(root, text="process started...").grid(row=6, column=3)
time.sleep(3)
#or some time consuming process...
root = Tk()
root.geometry("600x500")
button = Button (root, text="trial", command=function1)
button.grid(row=7, column=2)
root.mainloop()