I have a download button when clicked it calls a download function that downloads a video from a media url using wget example of a video url http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4
from tkinter import *
window = Tk()
name = Entry(window, width=10)
name.grid(column=0, row=0, sticky=W)
url = Entry(window, width=10)
url.grid(column=0, row=1, sticky=W)
dl_button = Button(window, text='download', command=dl) #*********
dl_button.grid(column=2, row=0, sticky=W)
status_lable = Label(window, text='Ready')
status_lable.grid(column=0, row=1, sticky=W)
bar = Progressbar(window, length=200)
bar.grid(column=1, row=1, sticky=W)
window.mainloop()
the dl function opens up 2 threads one for the download and one for the gui, the gui has a progress bar, that i want to be updated alongside the download:
import threading
from tkinter.ttk import Progressbar
import wget
def dl():
def wg():
wget.download(
url.get(), 'C:/Users/Desktop/downloads/'+name.get()+'.mp4')
def update_progress():
status_lable.config(text='Downloading...')
# also update the progress bar, based on the progress of the download from wget
dl_thread = threading.Thread(target=wg)
progress_thread = threading.Thread(target=update_progress)
dl_thread.start()
progress_thread.start()
is this doable, is it doable with somthing other than wget, or is it simply just not doable?
thx.