SimplestMachine / app.py
Tim Seufert
chat interface update test
c3f3e46
raw
history blame
1.01 kB
import time
import os
import tkinter as tk
class Clock:
def __init__(self):
self.time = time.strftime("%H:%M:%S")
def show_time(self):
self.time = time.strftime("%H:%M:%S")
print(f"The current time is {self.time}")
return self.time
class UI:
def __init__(self):
self.create_window = tk.Tk()
self.create_window.title("Clock")
self.create_window.geometry("400x400")
self.clock_label = tk.Label(self.create_window, text="The time is: ")
self.clock_label.pack()
self.clock_entry = tk.Entry(self.create_window)
self.clock_entry.pack()
self.clock_button = tk.Button(self.create_window, text="Show Time", command=self.show_time)
self.clock_button.pack()
self.create_window.mainloop()
def show_time(self):
clock = Clock()
current_time = clock.show_time()
self.clock_label.config(text=f"The time is: {current_time}")
if __name__ == "__main__":
ui = UI()