看板 Python 關於我們 聯絡資訊
我發現另一個問題了 我的 class 可能會在很多function丟出 Exception 如果是一般的functioin我可以正常接到 但是如果在 thread裡面丟出的話就接不到了 這是我的sample code from threading import Thread import time class T(Thread): def __init__(self): Thread.__init__(self) def run(self): print 'thread' time.sleep(1) raise Exception('kill') try: app = T() app.start() except Exception: print 'Catch kill' 我的猜測是在 try中 三個fun都執行完沒問題 所以就跳出 try / except這個部分了 然後thread在很久很久之後才出現exception 這時候就抓不到 我的理解有錯嗎 = =? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.114.91.77
sbrhsieh:看完這篇我好奇你心中的 thread 是什麼? 08/02 11:06
CMJ0121:一個process額外產生的小東西 他會自己跑自己的 08/02 11:20