Files
lm_code/test1.py

12 lines
240 B
Python
Raw Normal View History

2025-10-27 17:03:03 +08:00
import time
from tqdm import tqdm
2025-10-27 17:21:30 +08:00
pbar = tqdm(total=30,desc="正在执行任务",ncols=150)
2025-10-27 17:03:03 +08:00
2025-10-27 17:13:38 +08:00
for i in range(31): # 包含0~30
pbar.n = i # 直接设置进度
pbar.refresh() # 刷新显示
time.sleep(0.2)
2025-10-27 17:03:03 +08:00
2025-10-27 17:13:38 +08:00
pbar.close()