Python实现线程状态监测简单示例
作者:chengqiuming 时间:2023-12-07 20:31:25
本文实例讲述了Python实现线程状态监测。分享给大家供大家参考,具体如下:
# -*- coding:utf-8 -*-
from threading import Thread
import time
def func1():
time.sleep(10)
t1=Thread(target=func1)
print('t1:',t1.isAlive())
t1.start()
print('t1:',t1.isAlive())
t1.join(5)
print('t1:',t1.isAlive())
t1.join()
print('t1:',t1.isAlive())
运行结果:
希望本文所述对大家Python程序设计有所帮助。
来源:https://blog.csdn.net/chengqiuming/article/details/78601187
标签:Python,线程
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
golang切片原理详细解析
2024-04-29 13:06:35
vue3.0封装轮播图组件的步骤
2024-05-09 09:30:16
![](https://img.aspxhome.com/file/2023/9/128869_0s.jpg)
PHP中大于2038年时间戳的问题处理方案
2023-07-03 14:33:26
JavaScript+canvas实现七色板效果实例
2023-08-09 09:48:10
![](https://img.aspxhome.com/file/2023/9/56009_0s.png)
Linux下docker安装mysql8并配置远程连接
2024-01-18 15:53:43
![](https://img.aspxhome.com/file/2023/2/118122_0s.png)
Python新手入门之解释器的安装
2023-02-14 15:41:52
![](https://img.aspxhome.com/file/2023/7/133367_0s.png)
Python操作Redis之设置key的过期时间实例代码
2022-02-11 06:13:05
JS重现80后儿时经典拼板(模板)游戏
2011-09-11 18:36:46
python利用有道翻译实现"语言翻译器"的功能实例
2021-08-21 02:47:38
![](https://img.aspxhome.com/file/2023/7/84137_0s.png)
python实现字符串和数字拼接
2023-05-29 07:05:29
![](https://img.aspxhome.com/file/2023/6/128596_0s.jpg)
三分钟教会你用Python+OpenCV批量裁剪xml格式标注的图片
2023-07-09 14:11:01
![](https://img.aspxhome.com/file/2023/7/133547_0s.png)
Vue实现模糊查询的简单方法实例
2024-04-28 09:20:55
![](https://img.aspxhome.com/file/2023/1/133111_0s.png)
python连接MySQL、MongoDB、Redis、memcache等数据库的方法
2024-01-13 15:35:25
详解selenium + chromedriver 被反爬的解决方法
2022-03-20 18:40:46
python分析实现微信钉钉等软件多开分身
2023-07-22 18:37:12
![](https://img.aspxhome.com/file/2023/2/131012_0s.png)
简单谈谈MySQL的半同步复制
2024-01-15 01:04:50
kali2021.4a使用virtualenv安装angr的详细过程
2022-10-15 12:39:00
![](https://img.aspxhome.com/file/2023/4/131964_0s.png)
python命令行参数解析OptionParser类用法实例
2022-06-21 17:57:24
![](https://img.aspxhome.com/file/2023/6/70736_0s.gif)
python爬取基于m3u8协议的ts文件并合并
2021-11-03 16:44:45
完美的js验证网址url(正则表达式)
2008-06-07 09:36:00