python进度条
def pro(percent):
if percent > 1:
percent = 1
res = int(50 * percent) * '#'
print('\r[%-50s] %d%%' % (res, int(100 * percent)), end='')
recv_size = 0
total_size = 102501
while recv_size < total_size:
time.sleep(0.01)
recv_size += 1024
# print(recv_size)
percent = recv_size / total_size
pro(percent)