num = 0
import sys,time
for i in range(20):
num += 1
sys.stdout.write(' |%s%s|%s%%'%(' 33[1;31;0m▇ 33[0m'*num,'▇'*(20-num),num*5))
# sys.stdout.flush()
time.sleep(0.2)
sys.stdout.write(' |%s|%s'%(' 33[1;31;0m▇▇▇▇▇▇▇恭喜加载完成▇▇▇▇▇▇▇ 33[0m','100%'))
结果为
num = 0
import sys,time
for i in range(20):
num += 1
sys.stdout.write(' |%s%s|%s%%'%(' 33[1;31;0m▇ 33[0m'*num,'▇'*(20-num),num*5))
# sys.stdout.flush()
time.sleep(0.2)
sys.stdout.write(' |%s|%s'%(' 33[1;31;0m▇▇▇▇▇▇▇恭喜加载完成▇▇▇▇▇▇▇ 33[0m','100%'))
结果为