顯示具有 time 標籤的文章。 顯示所有文章
顯示具有 time 標籤的文章。 顯示所有文章

2010年12月19日 星期日

現在時間

import Tkinter
import time

curtime = ''
clock = Tkinter.Label()
clock.pack()

def tick():
    global curtime
    newtime = time.strftime('%H:%M:%S')
    if newtime != curtime:
        curtime = newtime
        clock.config(text=curtime)
    clock.after(200, tick)

tick()
clock.mainloop()