Thanks for taking the time to read this. I'm making a python project that automatically opens my meet links for class! The whole thing went well, but now i want a loading screen. Imagine this:
New window pops up Label appears: "Welcome to google meet!" i slowly config the label using time.sleep() to decrease visibility. then the label gets replaced by my app GUI! Sounded great in my head! Until i built it. The Time.sleep wasnt working, and it automatically skips to the next stage: GUI! and if i remove the gui part, it just stays blank.
My code:
#----------------SETUP-----------------------
from datetime import datetime
import pickle
from tkinter import *
import webbrowser
import datetime
import time
# all my imports
m = Tk()
W = Label(m, text="Welcome to google meet!", fg="#000000")
time.sleep(0.2)
W.pack()
time.sleep(1.2)
W.config(fg="#434343")
time.sleep(0.2)
W.config(fg="#8c8c8c")
time.sleep(0.2)
W.config(fg="#d2d2d2")
time.sleep(0.2)
W.config(fg="#eeeeee")
time.sleep(0.2)
W.config(fg="#ffffff")
W.destroy()
def Load():
w=Button(m, text="Open meet",bg="#F0F0F0", highlightthickness = 0, bd = 0)
m.title("Meet for Aparicio by ")
top = Tk()
top.title("Club Form")
copyrightt = Label(m, text="All rights reserved. Copyright by . Do not distribute as your own, but link to the google docs.")
L2 = Label(top, text="If this is your first time using this app, please fill out the form. If not, you can just ignore it.")
L2.pack()
copyrightt.pack()
ba = Button(top, text="Submit!") # there was a ,command=submit) but since i deleted the command, i just remvoed this for now, since i only need the GUI.
L3 = Label(top, text="Academic club link")
L3.pack()
E2 = Entry(top, bd =5)
E2.pack()
L5 = Label(top, text="Pastoral link")
L5.pack()
E4 = Entry(top, bd =5)
E4.pack()
L7 = Label(top, text="Interest link")
L7.pack()
E6 = Entry(top, bd =5)
E6.pack()
ba.pack()
m.geometry("700x250")
label = Label(m,text="Press the button below to open the link!")
img = PhotoImage(file="C:/Users/PKSNFL/Documents/Untitled.png") # make sure to add "/" not "/"
label.pack()
w.config(image=img)
w.pack()
wekday = datetime.datetime.today().weekday()
if wekday == 3:
l2 = Label(m, text="DISCLAIMER: IF YOU RUN THIS TWICE FROM 1:00 PM TO 2:00 PM, MESSAGE ON HOW TO FIX IT.")
l3 = Label(m, text="If you don't, the app will give you the wrong link for the rest of its life until you fix it :D")
l2.pack()
l3.pack()
Load()
#--------------------------------------------
#
m.mainloop()
I have cut out the code for my meet, and it has no relation to my tkinter code, except for the submit button.