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=102500recive=0while recive<totalsize: time.sleep(0.5) recive+=1024 percent=100*recive/totalsize jindu(percent)
时间: 2024-10-11 06:53:17