python处理进度条
生活随笔
收集整理的這篇文章主要介紹了
python处理进度条
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
2019獨(dú)角獸企業(yè)重金招聘Python工程師標(biāo)準(zhǔn)>>>
#!/usr/bin/python # coding: UTF-8 import time import sysdef progress_test():bar_length = 20for percent in xrange(0, 101):hashes = '#' * int(percent / 100.0 * bar_length)spaces = ' ' * (bar_length - len(hashes))sys.stdout.write("\rPercent: [%s] %d%%" % (hashes + spaces, percent))sys.stdout.flush()time.sleep(1)progress_test()轉(zhuǎn)載于:https://my.oschina.net/yves175/blog/804433
總結(jié)
以上是生活随笔為你收集整理的python处理进度条的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 关于朋友之间的友谊说说句子113个
- 下一篇: 置之不理的近义词