import sys def processBar(num, total): rate = num / total rate_num = int(rate * 100) if rate_num == 100: r = ‘\r%s>%d%%\n‘ % (‘=‘ * rate_num, rate_num,) else: r = ‘\r%s>%d%%‘ % (‘=‘ * rate_num, rate_num,) sys.stdout.write(r) sys.stdout.flush processBar(10,100)
原文地址:https://www.cnblogs.com/kuraki/p/9571531.html
时间: 2024-11-08 21:25:00