| | |
Tkinter Countdown
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Just a colorful ten second countdown to New Year. Hope you can learn some code from it.
# ten second countdown to New Year using Tkinter from Tkinter import * import time def countDown(): '''start countdown 10 seconds before new year starts''' lbl1.config(bg='yellow') lbl1.config(height=3, font=('times', 20, 'bold')) for k in range(10, 0, -1): lbl1["text"] = k root.update() time.sleep(1) lbl1.config(bg='red') lbl1.config(fg='white') lbl1["text"] = "Happy new year!" root = Tk() root.title("Happy ...") lbl1 = Label() lbl1.pack(fill=BOTH, expand=1) countDown() root.mainloop()
Similar Threads
- timer countdown (Java)
- Countdown program (C++)
- countdown timer (PHP)
- Tkinter Countdown Timer problems. (Python)
- Countdown (Java)
| Thread Tools | Search this Thread |
abrupt ansi anti apache approximation array backend beginner binary book builtin calculator character chmod converter countpasswordentry curved dan08 dictionaries dictionary drive dynamic examples excel exe file filename float format function graphics gui heads homework import inches input java launcher library line lines linux list lists loop mouse mysql mysqlquery number numbers numeric output parsing path phonebook plugin pointer port prime programming progressbar projects py2exe pygame pysimplewizard python random recursion redirect scrolledtext software statictext statistics string strings sum table terminal text textarea thread threading time tkinter tlapse trick tricks tuple tutorial twoup ubuntu unicode urllib urllib2 variable windows wordgame write wxpython



