I'm working on a project and when starting my program for the first time I want it to download some extra files, which were not incluided when it was getting installed. I want tkinter to show a window, telling the user what is going on and telling them what it is working on. It would be usefull for the window to be unclosable, and gets destroyed when the downloading is done. I'm not all too familiar with Tkinter, so the tk code is scrambeled together from a few websites. I'm using TK because I also need tk for a file picking dialog, and including pygame seems a bit exessive as a third GUI library (eel/tkinter/pygame).
The current (sample) code looks like this:
import tkinter as tk
import time
def donothing():
return
main = tk.Tk()
current_dependency = tk.StringVar()
current_dependency.set('Loading...')
main.geometry("500x170")
tk.Label(main, text= "Toolbox is\ndownloading dependencies...", font=('Helvetica 18 bold')).pack(pady=20)
tk.Label(main, textvariable = current_dependency, font=('Helvetica 16')).pack()
main.protocol('WM_DELETE_WINDOW',donothing) ## UNCLOSEABLE
def on_startup():
# Resolving dependencies
for exe in ('./ffmpeg/ffmpeg64.exe', './ffmpeg/ffprobe64.exe'):
# Running the code beneath, assuming the files are not present.
current_dependency.set(exe)
time.sleep(2)
main.mainloop()
if __name__ == '__main__':
on_startup()
time.sleep(2) is a stand-in for the function that downloads the current dependency
(please respond with python 3)