8
如何查看線程是否已完成?我嘗試了以下,但threads_list不包含已啓動的線程,即使我知道線程仍在運行。Python:線程仍在運行
import thread
import threading
id1 = thread.start_new_thread(my_function,())
#wait some time
threads_list = threading.enumerate()
# Want to know if my_function() that was called by thread id1 has returned
def my_function()
#do stuff
return
代碼未解釋的。你必須回答這個問題。如果您想提出建議,只需在評論中添加即可。哎呀,你需要更多的聲譽來做到這一點。直到那時,試着找到你認爲你的答案是*的問題*和解釋性的問題。 – rajuGT 2015-09-24 10:43:18