Little change
This commit is contained in:
parent
b3e6827191
commit
5fef37dc09
Binary file not shown.
|
@ -5,6 +5,7 @@ import os
|
|||
import threading
|
||||
import random
|
||||
import datetime
|
||||
import time
|
||||
import requests
|
||||
|
||||
class CenteredWindow(ctk.CTk):
|
||||
|
@ -157,7 +158,7 @@ class CenteredWindow(ctk.CTk):
|
|||
|
||||
def start_threads(self):
|
||||
# Hilo para actualizar el reloj
|
||||
self.update_time()
|
||||
threading.Thread(target=self.update_time, daemon=True).start()
|
||||
|
||||
# Hilo para actualizar la temperatura
|
||||
threading.Thread(target=self.update_temperature, daemon=True).start()
|
||||
|
@ -166,6 +167,7 @@ class CenteredWindow(ctk.CTk):
|
|||
threading.Thread(target=self.update_emails, daemon=True).start()
|
||||
|
||||
def update_time(self):
|
||||
while True:
|
||||
# Obtén la hora y la fecha actual
|
||||
current_time = datetime.now().strftime('%H:%M:%S')
|
||||
current_date = datetime.now().strftime('%d/%m/%Y')
|
||||
|
@ -175,7 +177,7 @@ class CenteredWindow(ctk.CTk):
|
|||
self.info_labels["fecha"].configure(text=f"Fecha: {current_date}")
|
||||
|
||||
# Programa la próxima actualización en 1000 ms (1 segundo)
|
||||
self.after(1000, self.update_time)
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue