In the line
remove the
toplevel_windows.after(3000, toplevel_windows.destroy())you have called the
destroy
method by using ()
so it happens imediatly, the result of the method is what is then called by after
remove the
()
so after makes the call itself.toplevel_windows.after(3000, toplevel_windows.destroy)P.S. I don't know why you have
mainloop
calls everywhere you should only have the one mainloop
call, the mainloop
call before the after
call is probably blocking so that when the window is destroyed and you call destroy
the window is already destroyed.