Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > why does my python's program die after change computer system time?

Reply
Thread Tools

why does my python's program die after change computer system time?

 
 
fuzziy
Guest
Posts: n/a
 
      06-03-2009
Microsoft windowsXP 中,在python2.6下运行如下程序,显示一个时间的窗口 5彼髯烂嬗蚁陆堑氖奔洌缓蟾氖奔浠蛉
期,多次更改后,我的时间窗口就死机了,时间不变了。 好像是after(200, tick)不运行了。不知道为怎么这个定时器会死掉呢。请 魑恢附蹋
谢谢!!

import Tkinter
import time

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

def tick():
global curtime
#print("1:")
newtime = time.strftime('%Y-%m-%d %H:%M:%S')
if newtime != curtime:
curtime = newtime
clock_label.config(text=curtime)
clock_label.config(text=newtime)
clock_label.after(200, tick)
#print(curtime)

tick()
clock_label.mainloop()

 
Reply With Quote
 
 
 
 
Gabriel Genellina
Guest
Posts: n/a
 
      06-03-2009
En Wed, 03 Jun 2009 04:08:03 -0300, fuzziy <(E-Mail Removed)>
escribi:

> [why does my python's program die after change computer system time?]


> def tick():
> ...show current time...
> clock_label.after(200, tick)


What do you mean by "die"?
Did you set the system time to an earlier value? Suppose now it is
09:15:00.000; your program says after(200, tick), that means that at
09:15:00.200 the tick() function will be called. If you
set the time back to 09:00:00 your program has 15 minutes still to wait.
It hasn't died, it's just waiting for the right time to arrive.

I'm not sure if this can be considered a bug, or not, or who's responsible
(tcl? tk? tkinter? python?...)

--
Gabriel Genellina

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
re: @Don postet euch den Film des Jahres " Die rache der Sith " in MVCD (028/110] - "Star Wars Episode 3 - Die Rache der Sith ( 1_2 MVCD ) ein @Don post.part28.rar" Marco Computer Support 0 05-22-2005 01:25 PM
Die IDE Die Lloyd Sheen ASP .Net 2 01-26-2004 04:59 AM
More Die IDE Die Lloyd Sheen ASP .Net 5 01-25-2004 02:34 PM
I want to be a hacker/nerd b4 I die. Ghost issues (now and after I die) O.Phooey Computer Support 4 07-05-2003 08:35 PM



Advertisments