I am trying to make an application which includes several tests. After receiving an answer to one question (the user must enter his answer and the application will tell him whether this answer is correct or not), you need to refresh the window and issue the next question. Unfortunately, I do not quite understand the logic of how to do this, so I wrote the code to train the output.
from tkinter import *
from tkinter import messagebox
from tkinter import ttk
def finish():
root.destroy()
print("Close")
root = Tk()
root.title("Test app")
root.geometry("900x900+500+70")
root.protocol("WM_DELETE_WINDOW", finish)
for i in range(10):
btn = Button(text=i)
btn.pack()
root.mainloop()
How can I make it so that when the button is clicked, the window is updated and the text in the button changes? root.mailoop() won't let me do it.
I read the documentation but didnt find any info how can I do this.