from time import sleep
def progress(percent=0, width=30):
left = width * percent // 100
right = width - left
print('[', '#' * left, ' ' * right, ']', f"{percent}%", sep='', flush=True)
for i in range(101):
progress(i)
sleep(0.1)
Python 实现一个进度条
最新推荐文章于 2024-09-10 13:01:50 发布