Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tkinter as tk
- from tkinter import *
- import time
- import datetime
- root = Tk()
- root.attributes("-fullscreen", True)
- time1 = 0
- clock = Label(root, font=('helvetica', 180, 'bold'), bg='black', fg='white')
- clock.pack(fill=BOTH, expand=1)
- cronometro = Label(root, font=('helvetica', 140, 'bold'), bg='black', fg='white')
- cronometro.pack(fill=BOTH, expand=1)
- def tick():
- global time1
- # Pegar horario do PC
- time2 = time.strftime('%H:%M:%S')
- # Se o tempo mudar, atualizar
- if time2 != time1:
- time1 = time2
- clock.config(text=time2)
- root.after(50, tick)
- tick()
- def countdown(count):
- cronometro['text'] = count
- if count > 0:
- root.after(1000, countdown, count-1)
- countdown(70)
- root.mainloop( )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement