-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
59 lines (32 loc) · 1011 Bytes
/
main.py
File metadata and controls
59 lines (32 loc) · 1011 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import tkinter as tk
from tkinter import *
import os
from time import strftime
root = tk.Tk()
root.title("Seu relógio")
root.geometry("600x320")
root.maxsize(600, 320)
root.minsize(600, 300)
root.configure(background = "#282a36")
def get_name():
nome_usuário = os.getlogin()
name.config(text="Ola, " + nome_usuário)
def get_data():
data_atual = strftime("%a, %d, %b, %Y")
data.config(text= data_atual)
def get_hora():
hora_atual = strftime("%H:%M:%S")
hora.config(text=hora_atual)
hora.after(1000, get_hora)
tela = tk.Canvas(root, width=600, height=60 ,bg="#282a36", bd=0, highlightthickness=0, relief="ridge" )
tela.pack()
name = Label(root, bg="#282a36", fg="#8e27ea" , font=("Montserrat" , 16))
name.pack()
data = Label(root, bg="#282a36", fg="#8e27ea" , font=("Montserrat" , 14))
data.pack(pady=2)
hora = Label(root, bg="#282a36", fg="#8e27ea" , font=("Montserrat" , 64, "bold"))
hora.pack(pady=2)
get_name()
get_data()
get_hora()
root.mainloop()