1
想象我有这样的代码(不写入实际的定时器还):删除线程计时器类?
class Timer(threading.Thread):
def __init__(self, seconds):
self.runTime = seconds
threading.Thread.__init__(self)
def run(self):
time.sleep(self.runTime)
#do some other function
print 'Finished'
t = Timer(60)
t.start()
一旦run()方法运行完毕后,是有一些方法来停止线程,并删除类的实例?
显然,评论必须超过15个字符,所以我不能只是说谢谢,你一直是一个真正的帮助^^ – Billie 2012-04-18 21:22:59