python 进度条
作者:互联网
1 2 3 4 5 6 7 8 9 10 11 |
#!/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)
|
标签:write,stdout,python,进度条,0.2,sys,f%,print 来源: https://www.cnblogs.com/onesea/p/15458779.html