Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 15 additions & 29 deletions Digital_Clock/clock.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
from tkinter import *
from tkinter import ttk
import tkinter as tk
# from tkinter import ttk
# import tkinter as tk
from time import sleep

from datetime import datetime

root = Tk()

# myText = Label(root)

root.title("Digital Time")
root.geometry("400x250")

Expand All @@ -21,37 +23,21 @@
myClock.place(x=50, y=20)


# mytText = tk.Entry(root, justify="center", width=6, font=("poppins", 50, "bold"), bg="black", border=0, fg="red")
# mytText.place(x=85, y=70)
# mytText.focus()


def timer():
while True:

getTime = datetime.now()
sleep(1)
myTextClock = getTime.strftime("%H:%M:%S")
# myText = Label(root, justify="center", width=6, font=("poppins", 45, "bold"), bg="black", border=0,
# fg="red")
# myText.place(x=85, y=75)
# while True:
getTime = datetime.now()
#sleep(1)
myTextClock = getTime.strftime("%H:%M:%S")

# return myText

# print(getTime.strftime("%H:%M:%S"))

myText = Label(root, justify="center", width=6, font=("poppins", 45, "bold"), bg="black", border=0,
fg="red")
myText.place(x=85, y=75)
myText.config(text=myTextClock)
myText = Label(root, justify="center", width=6, font=("poppins", 45, "bold"), bg="black", border=0,
fg="red")
myText.place(x=85, y=75)
# root.update(1000, timer)
root.after(1000, timer)
return myText.config(text=myTextClock)


timer()

# myClock = Label(root)
# canvas = Canvas(root, width=400, height=250)
# canvas.pack()
#
# tm = canvas.create_rectangle(200, 200, 150, 150, bd)

# root.after(1000, timer)
root.mainloop()
33 changes: 33 additions & 0 deletions LoginAccount.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import secrets
from tkinter import *

window = Tk()

window.geometry("350x300")

window.title("My Login")

window.resizable(False, False)

login = Label(window, justify="center", text="Login Window", fg="blue", font=("Candara", 20, "bold",))
login.place(x=85, y=20)

name = Label(window, text="Username:", font=("aria", 12, "bold"))
name.place(x=0, y=90)

passwd = Label(window, text="Password:", font=("arial", 12, "bold"))
passwd.place(x=0, y=130)

ntxt = Entry(window, width=40,)
ntxt.place(x=90, y=95)

ptxt = Entry(window, width=40, show='*')
ptxt.place(x=90, y=135)

lbtn = Button(window, text="Login", font=("Gabriola",), bg="green", width=10)
lbtn.place(x=200, y=200)

pbtn = Button(window, text="Cancel", font=("Gabriola",), bg="yellow", width=10)
pbtn.place(x=100, y=200)

window.mainloop()