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]
    
  • 相关阅读:
    世纪末的星期
    马虎的算式
    蜜蜂飞舞
    Torry 的困惑
    级数调和
    数列
    最大最小公倍数
    蚂蚁感冒
    12.integer to Roman
    13.Roman to Integer
  • 原文地址:https://www.cnblogs.com/wancy86/p/Python_tqdm.html
Copyright © 2011-2022 走看看