时间:2021-07-01 10:21:17 帮助过:64人阅读
#encoding=utf-8 import urllib import sys def cbk(a,b,c): per = 100.0*a*b/c if per >100: per=100 def cls(str): return '\r'*len(str) out='%.2f%%'%per sys.stdout.write(u'下载进度:') sys.stdout.write(out) sys.stdout.write(cls(out)) url="" urllib.urlretrieve(url,'download_123.mp3',cbk)