Reloj Digital en Python Con Tkinter
Reloj Digital en Python Con Tkinter
>>> ventana = Tk ()
''
>>> ventana.config(bg='white')
>>> ventana.geometry('350x250+10+10')
''
>>>
... x = texto_hora.winfo_height()
... t = int((x-5)*0.32)
... texto_dia.config(text=dia )
... texto_fecha.config(text=fecha)
...
>>> texto_dia.grid(row=1,sticky="nsew")
>>> texto_fecha = Label(ventana, fg = 'green2', bg='gray3', font = ('Comic Sans MS',20, 'bold'))
>>> texto_fecha.grid(row=2,sticky="nsew")
>>> obtener_tiempo()
>>> ventana.mainloop()
from tkinter import Label, Tk
ventana = Tk ()
ventana.title('Reloj Digital')
ventana.config(bg='white')
ventana.geometry('350x250+10+10')
ventana.minsize(width=250, height=200)
ventana.columnconfigure(0, weight=15)
ventana.rowconfigure(0, weight=15)
ventana.columnconfigure([1,2], weight=1)
ventana.rowconfigure([1,2], weight=1)
def obtener_tiempo():
hora = strftime('%H:%M:%S')
dia = strftime('%A')
x = texto_hora.winfo_height()
t = int((x-5)*0.32)
if dia =='Monday':
dia = 'Lunes'
dia = 'Martes'
dia = 'Miercoles'
dia = 'Jueves'
dia = 'Viernes'
dia = 'Sábado'
texto_dia.config(text=dia )
texto_fecha.config(text=fecha)
texto_hora.after(1000, obtener_tiempo)
texto_dia.grid(row=1,sticky="nsew")
texto_fecha.grid(row=2,sticky="nsew")
obtener_tiempo()
ventana.mainloop()