pastebin - collaborative debugging tool
kpaste.net RSS


zeit2.py
Posted by Anonymous on Tue 15th Jan 2019 08:58
raw | new post
modification of post by Anonymous (view diff)

  1. import tkinter as tk
  2. import time
  3.  
  4. counter = 0
  5. lt = time.localtime()
  6. def counter_label(label_Zeit, label_Datum):
  7.   counter = 0
  8.   def count():
  9.     global counter
  10.     counter += 1
  11.     lt = time.localtime()
  12.     label_Zeit.config(text="{0:02d}:{1:02d}:{2:02d} ".format(lt[3], lt[4], lt[5]))
  13.     label_Datum.config(text="{0:02d}.{1:02d}.{2:4d}".format(lt[2], lt[1], lt[0]))
  14.     label_Dauer.config(text="{0:d}".format(counter))
  15.     label_Zeit.after(1000, count)
  16.   count()
  17.  
  18. root = tk.Tk()
  19. root.resizable(False, False)
  20. root.wm_attributes("-topmost", 1)
  21. root.title("")
  22. label_Zeit = tk.Label(root, fg="blue2", font=("Realpolitik", 16))
  23. label_Datum = tk.Label(root, fg="dark blue", font=("Ink Free",16, "bold"))
  24. label_Dauer = tk.Label(root, fg="dark blue", font=("Ink Free",16, "bold"))
  25. label_Zeit.pack()
  26. label_Datum.pack()
  27. label_Dauer.pack()
  28. counter_label(label_Zeit, label_Datum)
  29. button = tk.Button(root, text='Stop',fg="DodgerBlue2", font=("Realpolitik Semi-Bold Semi-Ital", 16), width=25, command=root.destroy)
  30. button.pack()
  31. root.mainloop()

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.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}





All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at