-
-
Notifications
You must be signed in to change notification settings - Fork 101
Closed
Labels
Description
Description
I am now trying to build a multi-thread downloader with progressbar. When I try to get following result:
thread-1: |###### | ETA: 5s
thread-2: |#### | ETA: 7s
thread-3: |######## | ETA: 3s
While I only got one bar with changing prefixs(thread-1,thread-3...) and changing bar in console.
Having searched a lot but didn't find solution, so hope to get your help.
Simplified codes are as followed:
Code
def download():
respone=requests.get(url,stream=True)
for file in progressbar.progressbar(rsponse.iter_content(...)):
with open(dir,'w') as f:
f.write(file)
for i in range(3):
t=threading.Thread(target=download,...)
t.start
for i in range(3):
t.join()Versions
- Python version: 3.7
- Python distribution/environment: PyCharm
- Operating System: Windows 8.1
Reactions are currently unavailable