守护进程
守护进程守护的是进程的运行周期
from threading import Thread,enumerate,currentThread
import time
def task():
print('守护线程开始')
print(currentThread())
time.sleep(20)
# print('守护进程结束')
def task2():
print('子进程 start')
time.sleep(5)
print(enumerate())
print('子进程 end')
if __name__ == '__main__':
t1=Thread(target=task)
t2=Thread(target=task)
t1.daemon=True
t2.start()
t1.start()
print('主')