V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
Marsss
V2EX  ›  Python

tqdm 库在 windows 的 cmdshell 下,为什么进度条不是一条直线,样式可以修改吗?

  •  
  •   Marsss · 2018-08-16 12:39:58 +08:00 · 5146 次点击
    这是一个创建于 2073 天前的主题,其中的信息可能已经有所发展或是发生改变。
    我希望进度条显示样式是这样的:


    结果在 cmdshell 下显示的样式是这样的:


    有用过这个库的 TX 吗,是不是系统问题。
    4 条回复    2018-08-16 17:45:59 +08:00
    Trim21
        1
    Trim21  
       2018-08-16 12:48:05 +08:00 via Android   ❤️ 1
    似乎是 Unicode 的显示问题…
    设置 ncols 可以限制最大宽度,应该可以避免因为宽度不一直导致的换行
    我是设置了 ascii=True,换成了#号的样式
    Trim21
        2
    Trim21  
       2018-08-16 12:50:57 +08:00 via Android
    想要手动设置参数的话有 bar_format,emmm 不过我从来没设置成功过
    Marsss
        3
    Marsss  
    OP
       2018-08-16 13:54:03 +08:00
    @Trim21 好像暂时只能用你说的 ascii=True,换成#号样式了,虽然丑了点,至少是直的。。。
    yy461530593
        4
    yy461530593  
       2018-08-16 17:45:59 +08:00
    mac 下测试爬虫挺好用的库
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3760 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 05:04 · PVG 13:04 · LAX 22:04 · JFK 01:04
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.