Python Can';不要使用progressbar33软件包
我想显示下载进度,但无法按预期运行, 这是我的密码Python Can';不要使用progressbar33软件包,python,python-3.x,Python,Python 3.x,我想显示下载进度,但无法按预期运行, 这是我的密码 import requests from progressbar import Bar, ETA, FileTransferSpeed, ProgressBar link = video_mp4_link file_name = "download.mp4" with open(file_name, "wb") as f: print("Downloading {}".format(file_name)) response
import requests
from progressbar import Bar, ETA, FileTransferSpeed, ProgressBar
link = video_mp4_link
file_name = "download.mp4"
with open(file_name, "wb") as f:
print("Downloading {}".format(file_name))
response = requests.get(link, stream=True)
total_length = int(response.headers.get('content-length'))
widgets = ['[Downlaoding] ', Percentage(), ' ', Bar(),
' ', ETA(), ' ', FileTransferSpeed()]
pbar = ProgressBar(widgets=widgets, maxval=total_length).start()
for data in response.iter_content(chunk_size=4096):
f.write(data)
done = int(os.path.getsize('Tree_Scraper.py'))
pbar.update(done)
pbar.finish()
下载文件时,会显示如下进度:
[下载]0%|预计到达时间:35天,3:50:24 600 B/s
进度条卡在0%,预计到达时间为35~100天,下载速度为
B/s
下载文件后,进度如下: [码码>[倒倒老老丁]10%码码>[码码>[下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载下载 使用的软件包:
progressbar33
请求 发生了什么事