zoukankan      html  css  js  c++  java
  • Python字符进度条

    Python字符进度条

    看看这个神奇的module

    from tqdm import trange
    from time import sleep
    
    for r in trange(10, 1, -1):
        try:
            sleep(0.1)
        except:
            print()
            print("异常错误~~~")
            sleep(0.6)
    
      0%|          | 0/9 [00:00<?, ?it/s]
     11%|█         | 1/9 [00:00<00:00, 10.00it/s]
     22%|██▏       | 2/9 [00:00<00:00, 10.00it/s]
     33%|███▎      | 3/9 [00:00<00:00, 10.00it/s]
     44%|████▍     | 4/9 [00:00<00:00, 10.00it/s]
     56%|█████▌    | 5/9 [00:00<00:00, 10.00it/s]
     67%|██████▋   | 6/9 [00:00<00:00,  9.97it/s]
     78%|███████▊  | 7/9 [00:00<00:00,  9.98it/s]
     89%|████████▉ | 8/9 [00:00<00:00,  9.98it/s]
    100%|██████████| 9/9 [00:00<00:00,  9.99it/s]
    [Finished in 1.5s]
    
  • 相关阅读:
    🍖JS函数
    🍖JS流程控制
    🍖JS运算符介绍
    🍖JS数值类型与字符串类型的内置方法
    多态
    property装饰器
    封装
    组合
    继承&派生 属性查找
    继承与派生
  • 原文地址:https://www.cnblogs.com/wancy86/p/Python_tqdm.html
Copyright © 2011-2022 走看看