700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > python处理进度条

python处理进度条

时间:2023-12-06 03:49:36

相关推荐

python处理进度条

独角兽企业重金招聘Python工程师标准>>>

#!/usr/bin/python# coding: UTF-8import timeimport 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()

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。