Skip to content

Latest commit

ย 

History

History
132 lines (99 loc) ยท 6.94 KB

File metadata and controls

132 lines (99 loc) ยท 6.94 KB

tqdm

tqdm ่ฟ™ไนˆๆœ‰็‰Œ้ข็š„ๅบ“๏ผŒ็ซŸ็„ถๆฒกๆฒกๆœ‰ไป‹็ป๏ผŸ

็”จ่ตทๆฅ้žๅธธ็š„็ฎ€ๅ•๏ผŒไนŸ้žๅธธ็š„ๅฅฝ็”จใ€‚

ไธ€ไธชๅŸบๆœฌ็š„ๅฎžไพ‹

# coding=utf-8

import time
from tqdm import trange, tqdm

for i in trange(10):
    time.sleep(0.1)

for i in tqdm(range(100)):
    time.sleep(0.1)

ไธ€ไธชๅธธ่ง็š„็คบไพ‹

# coding=utf-8

import time
import random
from tqdm import tqdm


count = 0
total = 1024
progress = tqdm(total=total, unit='B',unit_scale=True, desc='filename')


while count < total:
  time.sleep(1)
  step = random.randrange(100)
  count += step
  progress.update(step)

progress.close()

alive-progress

ไนŸๅพˆๆœ‰ๆ„ๆ€

>>> import alive_progress
>>> alive_progress.showtime()
Welcome to alive-progress, enjoy! (ctrl+c to stop :)
=================================
showing: preconfigured spinners, with their unknown bar renditions
--> remember you can create your own!

fps: 15.03 (goal: 15.0)
fps: 15.03 (goal: 15.0)      classic       |----------------------------------------|
                   |||       classic       ||||||||||||||||||||||||||||||||||||||||||
                |  * |        stars        |      **********                        |
                   |โ†“|        arrow        |โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“โ†“|
                 |โ†“โ†™โ†|       arrows        |โ†“โ†™โ†โ†–โ†‘โ†—โ†’โ†˜โ†“โ†™โ†โ†–โ†‘โ†—โ†’โ†˜โ†“โ†™โ†โ†–โ†‘โ†—โ†’โ†˜โ†“โ†™โ†โ†–โ†‘โ†—โ†’โ†˜โ†“โ†™โ†โ†–โ†‘โ†—โ†’โ†˜|
                   |โ–‡|      vertical       |โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡โ–‡|
                 |โ–‡โ–…โ–ƒ|        waves        |โ–‡โ–…โ–ƒโ–โ–ƒโ–…โ–‡โ–‡โ–…โ–ƒโ–โ–ƒโ–…โ–‡โ–‡โ–…โ–ƒโ–โ–ƒโ–…โ–‡โ–‡โ–…โ–ƒโ–โ–ƒโ–…โ–‡โ–‡โ–…โ–ƒโ–โ–ƒโ–…โ–‡โ–‡โ–…โ–ƒโ–โ–ƒ|
                 |โ–‡โ–‚โ–…|       waves2        |โ–‡โ–‚โ–…โ–†โ–โ–†โ–…โ–‚โ–‡โ–„โ–ƒโ–ˆโ–ƒโ–„โ–‡โ–‚โ–…โ–†โ–โ–†โ–…โ–‚โ–‡โ–„โ–ƒโ–ˆโ–ƒโ–„โ–‡โ–‚โ–…โ–†โ–โ–†โ–…โ–‚โ–‡โ–„โ–ƒโ–ˆ|
                 |โ–‡โ–‚โ–‡|       waves3        |โ–‡โ–‚โ–‡โ–‚โ–‡โ–‚โ–‡โ–‚โ–‡โ–‚โ–‡โ–‚โ–‡โ–‚โ–‡โ–‚โ–‡โ–‚โ–‡โ–‚โ–‡โ–‚โ–‡โ–‚โ–‡โ–‚โ–‡โ–‚โ–‡โ–‚โ–‡โ–‚โ–‡โ–‚โ–‡โ–‚โ–‡โ–‚โ–‡โ–‚|
                   |โ–Ž|     horizontal      |โ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Žโ–Ž|
                   |โ „|        dots         |โ „โ „โ „โ „โ „โ „โ „โ „โ „โ „โ „โ „โ „โ „โ „โ „โ „โ „โ „โ „โ „โ „โ „โ „โ „โ „โ „โ „โ „โ „โ „โ „โ „โ „โ „โ „โ „โ „โ „โ „|
                   |โฃป|    dots_reverse     |โฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃปโฃป|
               |โ „โ ‚โ โ ˆโ |     dots_waves      |โ „โ ‚โ โ ˆโ โ  โข€โก€โ „โ ‚โ โ ˆโ โ  โข€โก€โ „โ ‚โ โ ˆโ โ  โข€โก€โ „โ ‚โ โ ˆโ โ  โข€โก€โ „โ ‚โ โ ˆโ โ  โข€โก€|
               |โ „โ โ โข€โ „|     dots_waves2     |โ „โ โ โข€โ „โ โ โข€โ „โ โ โข€โ „โ โ โข€โ „โ โ โข€โ „โ โ โข€โ „โ โ โข€โ „โ โ โข€โ „โ โ โข€โ „โ โ โข€|
                 |โˆ™โ—โˆ™|   ball_scrolling    |โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โ—โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™|
                 |โˆ™โ—โˆ™|   balls_scrolling   |โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โˆ™โ—โ—โ—โ—|
            |      โ— |    ball_bouncing    |                    โ—                   |
            |      โ— |   balls_bouncing    |                                  โ—โ—โ—โ—โ— |
                 |.. |     dots_recur      |      ..................................|
                |   =|      bar_recur      |    ==============================      |
               | โ–บโ–บ  |       pointer       |      โ–บโ–บโ–บโ–บโ–บโ–บโ–บโ–บโ–บโ–บโ–บโ–บโ–บโ–บโ–บโ–บ                  |
              | โ†’โ†’โ†’  |    arrows_recur     |                          โ†’โ†’โ†’โ†’โ†’โ†’โ†’โ†’โ†’โ†’โ†’โ†’โ†’โ†’|
              |  โ—€โ—€  |      triangles      |              โ—€โ—€โ—€โ—€โ—€โ—€โ—€โ—€โ—€โ—€โ—€โ—€โ—€             |
        | โ–ทโ–ทโ–ท    โ—€โ—€โ—€ |     triangles2      | โ–ทโ–ทโ–ท    โ—€โ—€โ—€  โ–ถโ–ถโ–ถ    โ—โ—โ—  โ–ทโ–ทโ–ท    โ—€โ—€โ—€  โ–ถโ–ถโ–ถ|
            |    <<< |      brackets       |                        <<<<<<<<<<<<<<< |
          |    โ—‹โ—‹โ—‹โ—‹โ—‹ |    balls_filling    |      โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—              |
          |  โ™ซโ™ซโ™ซโ™ซ    |        notes        |                  โ™ซโ™ซโ™ซโ™ซโ™ซโ™ซโ™ซโ™ซโ™ซโ™ซโ™ซโ™ซโ™ซโ™ซโ™ซโ™ซ      |
          |  โ™ฌโ™ฌโ™ฌโ™ฌ    |       notes2        |  โ™ซโ™ซโ™ซโ™ซโ™ซโ™ซโ™ซโ™ซโ™ซโ™ซโ™ซโ™ซโ™ซโ™ซโ™ซโ™ซ                      |
          |      โ™ฉโ™ฉโ™ฉโ™ฉ|   notes_scrolling   |      โ™ชโ™ชโ™ชโ™ชโ™ชโ™ชโ™ชโ™ชโ™ชโ™ชโ™ชโ™ชโ™ชโ™ชโ™ชโ™ช                  |
        |  >>>><<<<  |   arrows_incoming   |                  ....                  |
        |<<<<    >>>>|   arrows_outgoing   |..                                    ..|
  |    >>------>     |     real_arrow      |                           >>------>    |
     | ><(((('>      |        fish         |      ><(((('>                          |
    |.ยธ><(((ยบ>       |        fish2        |ยทยดยฏ`ยท.ยทยดยฏ`ยท.ยธยธ.ยทยดยฏ`ยท.ยธ><(((ยบ>           |
  |      ><(((('>    |    fish_bouncing    |              ><(((('>                  |
  |                 <|       fishes        | <><                                    |
      |ait...        |  message_scrolling  |please wait...                          |
     |      please   |  message_bouncing   |                                  wait  |
     |longer than ant|    long_message     |his is taking longer than anticipated, h|
      |โ€“โ€“โ€“โ€“โ€“โˆš\/โ€ขโ€“โ€“โ€“โ€“โ€“|        pulse        |โ€“โ€“โ€“โ€“โ€“โˆš\/โ€ขโ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โˆš\/โ€ขโ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โˆš\/โ€ขโ€“โ€“โ€“|
^C>>>
>>> alive_progress.show_bars()
Welcome to alive-progress, enjoy! (ctrl+c to stop :)
=================================
showing: preconfigured bars
--> remember you can create your own!

fps: 15.03 (goal: 15.0)
   classic [===================================>    ]

  classic2 [################........................]

    smooth |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‰                                |

    blocks |โ–‰โ–‰โ–‰โ–Ž                                    |

   bubbles <โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โˆ™           >

   circles <โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—โ—‹โ—‹โ—‹โ—‹โ—‹>

    hollow <โ’โ’โ–ท                                     >

   squares <โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ’โ’โ’โ’โ’โ’โ’โ’โ’โ’โ’โ’โ’โ’โ’โ’โ’โ’โ’โ’โ’โ’>

     solid <โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ– โ–บ                 >

    checks |โœ“โœ“                                      |

   filling |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–…                |

^C>>>