Skip to content

Commit 30fb557

Browse files
[投稿] 添加脚本: 效果进度条 — by ioo
1 parent e2e0278 commit 30fb557

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# 欢迎使用 PythonIDE!如果觉得好用,请给个好评哦~
2+
import time
3+
R = "\033[91m" # 红
4+
G = "\033[92m" # 绿
5+
Y = "\033[93m" # 黄
6+
X = "\033[0m" # 重置
7+
print("普通")
8+
t='█'
9+
for i in range(51):
10+
k=i*2
11+
print(f"\r|{i*'█'}{(50-i)*' '}|{k}%",end="")
12+
time.sleep(0.08)
13+
#高级
14+
print("\n高级")
15+
def load():
16+
17+
for i in range(51):
18+
if i*2<30:
19+
types=R
20+
elif i*2>30 and i*2<60:
21+
types=Y
22+
elif i*2>60:
23+
types=G
24+
print(f"\r|{types}{i * t}{X}|{(49 - i) * '-'}{i*2}%", end="\033[A")
25+
time.sleep(0.08)
26+
load()

0 commit comments

Comments
 (0)