发布时间:2019-08-26 07:53:37编辑:auto阅读(4758)
__author__ = 'LL_YING' ''' 线程创建之后,可以使用Thread对象的isAlive方法查看线程是否运行,为True则运行 ''' import threading import time class myThread(threading.Thread): def __init__(self, num): threading.Thread.__init__(self) self.num = num def run(self): time.sleep(5) print(self.num) def func(): t.start() print(t.isAlive()) t = myThread(1) func() t = myThread(1) # 输出 # True # 1
上一篇: python中的list函数(部分截取)
下一篇: 简单的python画图小实例
50958
50341
40956
37826
32289
29179
28069
22897
22858
21191
1051°
1728°
1410°
1349°
1611°
1439°
2095°
3637°
3563°
2510°