码迷,mamicode.com
首页 > 编程语言 > 详细

守护线程

时间:2018-09-10 11:11:01      阅读:199      评论:0      收藏:0      [点我收藏+]

标签:while   from   def   threading   code   线程   UNC   import   nbsp   

import time
from threading import Thread

def func1():
    while True:
        print(**10)
        time.sleep(1)

def func2():
    print(in func2)
    time.sleep(5)

t = Thread(target=func1,)
t.daemon = True
t.start()
t2 = Thread(target=func2,)
t2.start()
# t2.join()
print(主线程)

 

import time
from threading import Thread,Lock

def func():
    print(666)
    time.sleep(10)

def func2():
    pass

t = Thread(target=func)
t.daemon = True
t.start()
print(主线程)

 

守护线程

标签:while   from   def   threading   code   线程   UNC   import   nbsp   

原文地址:https://www.cnblogs.com/kuraki/p/9617319.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!