-
-
Save gabrielfern/9f11e4f162b9c7e10917fa09d1b3d4b1 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 hidden or 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