pastebin - collaborative debugging tool
kpaste.net RSS


zeit.py
Posted by Anonymous on Tue 15th Jan 2019 08:57
raw | new post
view followups (newest first): zeit2.py by Anonymous

  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_Zeit.after(1000, count)
  15.   count()
  16.  
  17. root = tk.Tk()
  18. root.resizable(False, False)
  19. root.wm_attributes("-topmost", 1)
  20. root.title("")
  21. label_Zeit = tk.Label(root, fg="blue2", font=("Realpolitik", 16))
  22. label_Datum = tk.Label(root, fg="dark blue", font=("Ink Free",16, "bold"))
  23. label_Zeit.pack()
  24. label_Datum.pack()
  25. counter_label(label_Zeit, label_Datum)
  26. button = tk.Button(root, text='Stop',fg="DodgerBlue2", font=("Realpolitik Semi-Bold Semi-Ital", 16), width=25, command=root.destroy)
  27. button.pack()
  28. 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