- import tkinter as tk
- import time
- counter = 0
- lt = time.localtime()
- def counter_label(label_Zeit, label_Datum):
- counter = 0
- def count():
- global counter
- counter += 1
- lt = time.localtime()
- label_Zeit.config(text="{0:02d}:{1:02d}:{2:02d} ".format(lt[3], lt[4], lt[5]))
- label_Datum.config(text="{0:02d}.{1:02d}.{2:4d}".format(lt[2], lt[1], lt[0]))
- label_Zeit.after(1000, count)
- count()
- root = tk.Tk()
- root.resizable(False, False)
- root.wm_attributes("-topmost", 1)
- root.title("")
- label_Zeit = tk.Label(root, fg="blue2", font=("Realpolitik", 16))
- label_Datum = tk.Label(root, fg="dark blue", font=("Ink Free",16, "bold"))
- label_Zeit.pack()
- label_Datum.pack()
- counter_label(label_Zeit, label_Datum)
- button = tk.Button(root, text='Stop',fg="DodgerBlue2", font=("Realpolitik Semi-Bold Semi-Ital", 16), width=25, command=root.destroy)
- button.pack()
- root.mainloop()
zeit.py
Posted by Anonymous on Tue 15th Jan 2019 08:57
raw | new post
view followups (newest first): zeit2.py by Anonymous
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.