I am trying to displey a few labels for exact amount of time and than forget them. I tried with sleep() and time.sleep(), but the program started after time I have defined and than executes lines. Here is part of my program:
from time import sleep
from tkinter import*
from tkinter import ttk
root = Tk()
root.geometry('700x700+400+100')
root.overrideredirect(1)
myFrame=Frame(root)
label1=Label(myFrame, text='Warning!', font=('Arial Black', '26'), fg='red')
myFrame.pack()
label1.pack()
sleep(10)
myFrame.pack_forget()
label1.pack_forget()
But when I run the program it wait for 10 seconds and than executes the lines (frame and label are packed and than immediatly forget).
I hope it is clear, what problem I have.
.pack) and than immediatly forget (.pack_forget()).