from time import sleep

def progress(percent=0, width=30):
    left = width * percent // 100
    right = width - left
    print('\r[', '#' * left, ' ' * right, ']',f' {percent:.0f}%',sep='', end='', flush=True)

for i in range(101):
    progress(i)
    sleep(0.1)

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-02
  • 2021-11-07
  • 2022-01-11
  • 2021-10-30
  • 2021-06-11
  • 2021-05-19
猜你喜欢
  • 2021-09-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-22
相关资源
相似解决方案