I wrote a gui class using Tkinter:
def start_gui():
def do_some_task():
dosometask
def do_some_task2():
dosometask2
ttk.Button(mainframe, text="task1", command=do_some_task).grid(column=1, row=3, sticky=W)
ttk.Button(mainframe, text="task2", command=do_some_task2).grid(column=2, row=3, sticky=W)
if __name__ == "__main__":
start_gui()
When I press either one of the buttons the GUI is freezing until the task is finished. How can threading be used to prevent this, making both buttons usable at all times?