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