Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Tk_counting_upward.py
- import tkinter as tk
- def counter_label(label):
- def count():
- label['text'] += 1
- label.after(1000,count)
- count()
- root = tk.Tk()
- root.title ("Counting Upward")
- label = tk.Label(root, fg = "green")
- label.pack()
- label['text'] = -1
- button = tk.Button(root, text='Stop', width=25, command=root.destroy)
- button.pack()
- counter_label(label)
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement