标签:success python format out 实时 sleep sys float port
import sys
import time
n = 1
while n <= 100:
sys.stdout.write(‘{}{:.0f}%\r‘.format(‘*‘ * n, float(n / 100) * 100))
if n == 100:
sys.stdout.write(‘Success\n‘)
time.sleep(0.1)
n += 1
>
import sys
import time
n = 1
while n <= 100:
sys.stdout.write(‘{}‘.format(‘*‘))
sys.stdout.flush()
if n == 100:
sys.stdout.write(‘Success\n‘)
time.sleep(0.1)
n += 1
标签:success python format out 实时 sleep sys float port
原文地址:https://www.cnblogs.com/halvin/p/14241131.html