This commit is contained in:
27942
2025-10-27 17:03:03 +08:00
parent 3e92955fea
commit 50ced0200f
2 changed files with 41 additions and 4 deletions

View File

@@ -1,2 +1,26 @@
if 0:
print(1)
import time
from tqdm import tqdm
from datetime import datetime
# 获取当前时间的分钟数
def get_current_minute():
now = datetime.now()
return now.minute
# 计算进度
def calculate_progress(minute):
return minute % 30
# 创建进度条
with tqdm(total=30, desc="时间进度", unit="分钟") as pbar:
while True:
current_minute = get_current_minute()
progress = calculate_progress(current_minute)
# 重置进度条并更新到计算出的进度
pbar.reset()
pbar.update(progress)
# 每秒更新一次进度条
time.sleep(1)