Subir archivos a "/"

This commit is contained in:
mireya 2025-12-07 19:58:16 +00:00
parent 247021823c
commit dc854fe553
1 changed files with 23 additions and 0 deletions

23
utility_thread.py Normal file
View File

@ -0,0 +1,23 @@
# utility_thread.py
import datetime
import time
import threading
def update_time(status_label):
"""Función que actualiza la hora y el día de la semana en un label en un hilo."""
while True:
now = datetime.datetime.now()
day_of_week = now.strftime("%A")
time_str = now.strftime("%H:%M:%S")
date_str = now.strftime("%Y-%m-%d")
label_text = f"{day_of_week}, {date_str} - {time_str}"
# Usamos after para actualizar el widget de Tkinter de forma segura
status_label.after(1000, status_label.config, {"text": label_text})
time.sleep(1)
def start_time_thread(status_label):
"""Inicia el hilo del reloj."""
update_thread = threading.Thread(target=update_time, args=(status_label,))
update_thread.daemon = True
update_thread.start()