python - 这种终端任务柱状图怎么写?[图]
PHP中文网
PHP中文网 2017-04-18 09:28:05
0
2
200

用pip安装时候显示的任务柱状图,可以检测任务

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(2)
伊谢尔伦
  • tqdm Refer to the demo on the website.

  • Progress Bar for Console Programs as Iterator If you want to write it yourself, you can refer to this, it is also very good.

黄舟

print()其实就可以。用unicode的字符表示进度。然后用"r"Remove the carriage return.

Just one code is enough:

import time

i = 1
while i < 50:
    s = "█" * i
    print("{}\t\t{}".format(s, i), end="\r")
    i += 1
    time.sleep(1)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template