Hello. There was such a question for python 2.7, I have a gui form (Tkinter library) which displays the text, how to make it so that after 20 seconds we assume it closes itself.

Sample form:

import Tkinter from Tkinter import* inf = "Hello world" app = Tk() app.title("title") app.geometry("450x200+100+0") label1 = Label(text=inf) label1.grid() app.mainloop() 

1 answer 1

To exit the GUI, completing the mainloop, after 20 seconds:

 app.after(20000, app.destroy)