python 进度条

舟海君

关注

阅读 160

2022-06-20

 

#!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys,time
for a in range(101):
#print a
b = 100 -a
#print b
#sys.stdout.write(("\r[%s%s]%0.2f%%" %("#"*a,b*"",float(a))))
sys.stdout.write(("\r[%s%s]%0.2f%%"%("#"*a,b*" ",float(a))))
sys.stdout.flush()
time.sleep(0.1)


精彩评论(0)

0 0 举报