Skip to content

Instantly share code, notes, and snippets.

@gabrielfern
Forked from ramalho/relogio.py
Created August 16, 2017 02:16
Show Gist options
  • Save gabrielfern/9f11e4f162b9c7e10917fa09d1b3d4b1 to your computer and use it in GitHub Desktop.
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
#!/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