标签:import res print end har str def time else
import time
def progress_bar(num, total):
rate_num = int(num / total * 100)
res = ‘\r%s> %d%%\n‘ % (‘=‘ * rate_num, rate_num) if rate_num == 100 else ‘\r%s> %d%%‘ % (‘=‘ * rate_num, rate_num)
print(res, end=‘‘)
# if rate_num == 100:
# res = ‘\r%s> %d%%\n‘ % (‘=‘ * rate_num, rate_num)
# else:
# res = ‘\r%s> %d%%‘ % (‘=‘ * rate_num, rate_num)
# print(res, end=‘‘)
progress_bar(26000, 300000)
# for i in range(0, 101, 2):
# time.sleep(0.1)
# char_num = i // 2 # 打印多少个 *
# per_str = ‘\r%s%% : %s\n‘ % (i, ‘*‘ * char_num) if i == 100 else ‘\r%s%% : %s‘ % (i, ‘*‘ * char_num)
# print(per_str, end=‘‘, flush=True)
标签:import res print end har str def time else
原文地址:https://www.cnblogs.com/Neeo/p/9574705.html