Jan-07-2022, 03:14 PM
(This post was last modified: Jan-07-2022, 03:27 PM by Yoriz.
Edit Reason: Added prefix
)
hi, sorry again for my bad English,
I like to create "loading, please wait... " window
but somehow the windows do not appear, this is the code
I will appreciate any clue, link, or working code,
thank you, have a nice day
I like to create "loading, please wait... " window
but somehow the windows do not appear, this is the code
import threading import time from tkinter import * done = False #here is the animation def PW(): """ NW = Toplevel(root) NW.title("Loading") NW.geometry("200x200") NWLabel(NW,text ="Please wait").pack() """ x = 0 global done while not done: x = x + 1 print(x)# just for tracking if program is running time.sleep(0.1) """ NW.destroy() """ def starting(): t = threading.Thread(target=PW) t.start() #long process start time.sleep(10) #long process stop global done done = True root = Tk() root.geometry("300x100") root.title("unstart") btn = Button(root, text ="Click", command = starting) btn.grid() mainloop()note : I put some comments in the code that I hope someone in here will edit,
I will appreciate any clue, link, or working code,
thank you, have a nice day