标签:end int ota jin png str .com image flush
def jindu(per,width=50):
if per>100:
per=100
showstr=(‘[%%-%ds]‘ % width) % (int(per/100*width) * ‘#‘)
print(‘\r%s %d%%‘ %(showstr,per), end=‘‘, flush=True)
totalsize=102500
recive=0
while recive<totalsize:
time.sleep(0.5)
recive+=1024
percent=100*recive/totalsize
jindu(percent)
标签:end int ota jin png str .com image flush
原文地址:http://www.cnblogs.com/oldmadman/p/7339866.html