Python语言-NL-简单的开始
程序员文章站
2022-05-19 08:18:42
...
#TextProBarV1.py
import time
scale=10
print("------执行开始------")
for i in range(scale+1):
a='*'*i
b='.'*(scale-i)
c=(i/scale)*100
print("{:^3.0f}%[{}->{}]".format(c,a,b))
time.sleep(0.1)
print("------执行结束------")
Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>>
================= RESTART: E:/SCUT/Python/Code/TextProBarV1.py =================
------执行开始------
0 %[->..........]
10 %[*->.........]
20 %[**->........]
30 %[***->.......]
40 %[****->......]
50 %[*****->.....]
60 %[******->....]
70 %[*******->...]
80 %[********->..]
90 %[*********->.]
100%[**********->]
------执行结束------
>>>