# -*- coding: utf-8 -*- from Tkinter import * import urllib, ttk, tkMessageBox from threading import Thread def downloader(): urllib.urlretrieve('http://cs521111v4.vk.me/u176613573/audios/d622212d34bf.mp3','Big K.R.I.T. – Bigger Picture.mp3') th=Thread(target=downloader,args=()) def starter(event): th.start() pb.pack() pb.start() root= Tk() pb = ttk.Progressbar(length = 200, orient = 'horizontal', mode = 'indeterminate') but = Button(root, text = 'Go!') root.minsize(width = 400, height = 350) but.bind('<Button-1>', starter) but.pack() root.mainloop()
Пробовал так:
def downloader(): urllib.urlretrieve('http://cs521111v4.vk.me/u176613573/audios/d622212d34bf.mp3','Big.mp3') tkMessageBox.showinfo('Done')