From 5fef37dc09e5f5de9b1eef941cebd6d6315d59a7 Mon Sep 17 00:00:00 2001 From: DennisEckerskorn Date: Tue, 3 Dec 2024 19:05:12 +0100 Subject: [PATCH] Little change --- .../centered_window.cpython-312.pyc | Bin 13207 -> 13294 bytes src/ui/centered_window.py | 20 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/ui/__pycache__/centered_window.cpython-312.pyc b/src/ui/__pycache__/centered_window.cpython-312.pyc index 1863594240525586d436d6a7607f13e209aa50fb..5dcc6f56f718a4d69affd187b8dc9bdc9651f532 100644 GIT binary patch delta 756 zcmZvZT}V@L7{u+ZO*ODm7n{tf^0~{GV?3?AgPQT?YIm-&t_g2Bw|r$ z<$NKFF6QteN(19uG$_0agphW0Fr9Yig^-ApUUXIGh~4?WczAgD@$kO?cQUXY(0Vd9-;g)7Vc$Z*sKdbV?guqJ%fg#x_%Kzf@TTKN?nt%M$aEq_Z6WBh_i24KSZjAC3g>J>0c z&(Jt%D8T2m8cT9C_$6D9(ac=gVR?_)g2M)#$ZB!UoL8+1-Q`%HzoR>lQeNG+DNTQ` z-xp$UhdR30lp+}NaiLV!|BUVGWjSA{pJS1>oGp!rO9$_WGDK}KnMo#3VDhHqNwZTh zJ7d`irY6aF1;(3TYVoG!7VQO$mfLV17%V-a$3K=;I;26!Ez~kIAblW30W~&-#Cl4` z4O3WWJx1gQb9Az7FAiE=5XBGHqKEH9HaIHE5Vew)wPCPEJg+@(YLW)GU~tb>FB@u} zG_D_-?kFj3W|9~MVtjQ?Ahsl_6iDSF^@eDrBLv;pR#jxstWoK^@-7*aj$fH<3AgM~lIM&f@edZ7 B@=gE% delta 785 zcmZutUr1A76#ve>+q%1RTK?IbuG-wP+)_7QFgggy3zn}M=#!(HSm2XXVu*B-W}u=u1|ZU3 zU4jGFEDdewurep>kGkFLG(#&q7c`HC7&o^jeWm)gxU$$QRpE_E+xigD_r(0mxK51rZOXeoT1LJ#?9-aOPf*oj>+bCF^$n&_A@mtRep`)_qgNA$)&wuVg#XNz$z zg>y~iN34<5sHZy0xn{YVcWcgv%?f9aac+fkPnAXXM2e!`Ls8B>%hj4zh5Gqx{J@Uk z%$TJ>u@t=FT=HG#9Kaa%&HG7SVecmhru} z0peIza!jZGlQ@q3CH27Le92BNuXTU7qP5gpY=|4rwS}dYpmeb*r2gq%l{>A1Dja88 z!s3|vdZEGuUM?-DT%ak?8!o1>!~!)$aua03YUmSWeS#PhB#p)o%_SCG1ILFN1{+q0 Jnu}IC^Bap9@v#5^ diff --git a/src/ui/centered_window.py b/src/ui/centered_window.py index 8b1c4e0..7e61f63 100644 --- a/src/ui/centered_window.py +++ b/src/ui/centered_window.py @@ -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,16 +167,17 @@ class CenteredWindow(ctk.CTk): threading.Thread(target=self.update_emails, daemon=True).start() def update_time(self): - # Obtén la hora y la fecha actual - current_time = datetime.now().strftime('%H:%M:%S') - current_date = datetime.now().strftime('%d/%m/%Y') + 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') - # Actualiza las etiquetas - self.info_labels["hora"].configure(text=f"Hora: {current_time}") - self.info_labels["fecha"].configure(text=f"Fecha: {current_date}") + # Actualiza las etiquetas + self.info_labels["hora"].configure(text=f"Hora: {current_time}") + 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) + # Programa la próxima actualización en 1000 ms (1 segundo) + time.sleep(1)