Last active
April 17, 2022 22:21
-
-
Save ramalho/6417872 to your computer and use it in GitHub Desktop.
Um relógio bem simples feito em Python com Tkinter. Vídeo de demonstração: http://www.youtube.com/watch?v=xCiPshN9nOs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import tkinter | |
from time import strftime | |
def tic(): | |
rel['text'] = strftime('%H:%M:%S') | |
def tac(): | |
tic() | |
rel.after(1000, tac) | |
rel = tkinter.Label() | |
rel['font'] = 'Helvetica 120 bold' | |
rel.pack() | |
tac() | |
# para que funcione como um script, temos que chamar mainloop, | |
# senão o programa termina imediatamente após a chamada tac() | |
rel.mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment