独角兽企业重金招聘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()