tqdm.tqdm覆盖arg位置= gnome末端完成后的int = int
编辑:由bash
而不是tqdm
添加三个下载任务。指定。 完成任务后,无论分配了什么位置,它都会移至最高,并且底部的任务转移到了新线路,并在完成后的下一个终端输入中断。
with tqdm(
total=total,
unit="B",
unit_scale=True,
unit_divisor=1024,
leave=True,
ncols=100,
colour="green",
position=index,
dynamic_ncols=True,
desc=f"{index}",
) as progress_bar, open(filelocation, "wb") as f:
for chunk in r.iter_content(1024):
progress_bar.update(len(chunk))
if chunk:
f.write(chunk)
PS:在图中,您可以看到任务2
从其位置跳了两次。
EDIT : Caused by bash
and not tqdm
Three download tasks are added with threading.Thread
and the position for each of them is specified.
Upon completion of a task, it moves to the top irrespective of what position it was assigned, and the task at the bottom shifts to the new line and interrupts with the next input of the terminal upon completion.
with tqdm(
total=total,
unit="B",
unit_scale=True,
unit_divisor=1024,
leave=True,
ncols=100,
colour="green",
position=index,
dynamic_ncols=True,
desc=f"{index}",
) as progress_bar, open(filelocation, "wb") as f:
for chunk in r.iter_content(1024):
progress_bar.update(len(chunk))
if chunk:
f.write(chunk)
PS: In the figure you can see task 2
has taken two jumps from its place.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论