【问题标题】:Remove an '?' char from tqdm progressbar?删除“?”来自 tqdm 进度条的字符?
【发布时间】:2021-02-15 21:39:59
【问题描述】:

我编写了一个使用tqdm 模块下载带有进度条的视频的代码,它工作正常,只是有一个“?” char出现在进度条中,只出现在cmd中。

这是一张照片 progressbar

我们将不胜感激。

【问题讨论】:

  • 如果您在 Windows 下工作,cmd 在显示 utf8 字符时会出现一些问题。尝试ascii=True 作为参数。

标签: python cmd request progress-bar tqdm


【解决方案1】:

tqdm 的FAQ and Known Issueshere 中写到windows 对unicode 字符有一些问题。使用参数ascii=True 来解决这个问题。

from time import sleep
from tqdm import trange

for i in trange(100, ascii=True):
    sleep(0.01)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-09-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多