I am trying to print a string after some delay in my sample program. The problem I am facing is, I am getting the first string immediately without delay and second string after the delay. What I am doing wrong? Please correct me. Here is my code:
import tkinter as tk
root = tk.Tk()
root.title("after method")
root.geometry("100x100")
def displayint():
print("hello world")
def display():
root.after(5000,displayint())
root.after(10000,displayint())
button = tk.Button(root,text='press',command = display)
button.pack()
root.mainloop()