pastebin - collaborative debugging tool
kpaste.net RSS

Difference between
modified post 3da3b by Anonymous on Tue 15th Jan 2019 08:58
original post 0b258 by Anonymous on Tue 15th Jan 2019 08:57
Download diff
Show old version | new version | both versions

    
11
import tkinter as tk
22
import time
44
counter = 0
55
lt = time.localtime()
66
def counter_label(label_Zeit, label_Datum):
77
  counter = 0
88
  def count():
99
    global counter
1010
    counter += 1
1111
    lt = time.localtime()
1212
    label_Zeit.config(text="{0:02d}:{1:02d}:{2:02d} ".format(lt[3], lt[4], lt[5]))
1313
    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))
1415
    label_Zeit.after(1000, count)
1516
  count()
1718
root = tk.Tk()
1819
root.resizable(False, False)
1920
root.wm_attributes("-topmost", 1)
2021
root.title("")
2122
label_Zeit = tk.Label(root, fg="blue2", font=("Realpolitik", 16))
2223
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"))
2325
label_Zeit.pack()
2426
label_Datum.pack()
27+
label_Dauer.pack()
2528
counter_label(label_Zeit, label_Datum)
2629
button = tk.Button(root, text='Stop',fg="DodgerBlue2", font=("Realpolitik Semi-Bold Semi-Ital", 16), width=25, command=root.destroy)
2730
button.pack()
2831
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