8 Dec
2015
8 Dec
'15
12:09 a.m.
Anthony Green added the comment: The following example comes from IRC user ztane:
import threading, time
main_thread = threading.current_thread()
def foo(): time.sleep(10) print(main_thread.is_alive()) print(list(threading.enumerate()))
t = threading.Thread(target=foo) t.start()
False
[<_MainThread(MainThread, stopped 140040101766976)>,