技术栈

PYTHON使用小结

白杨攻城狮2024-10-19 18:08

线程使用

python 复制代码
import threading

thread01 = None

def ThreadFunc(param)
    xxxxx


def Test()
    global thread01 
    thread01 = threading.Thread(target=ThreadFunc)
    thread01.daemon = True  #设置为TRUE,主线程结束后,此线程也会退出, 默认False
    thread01.start()
    
    

也可以在创建线程时给参数

thread01 = threading.Thread(target=ThreadFunc,name="t1",daemon=True)

等待线程中止

thread01.join()

上一篇:ARINC 429总线协议
下一篇:对低代码的一些理解
相关推荐
豐儀麟阁贵
9 分钟前
8.2异常的抛出与捕捉
java·开发语言·python
interception
32 分钟前
爬虫js逆向,jsdom补环境,抖音,a_bogus
javascript·爬虫·python
林炳然
38 分钟前
Python-Basic Day-5 函数-生成器&装饰器
python
Yue丶越
1 小时前
【Python】基础语法入门(四)
linux·开发语言·python
AI街潜水的八角
5 小时前
Python电脑屏幕&摄像头录制软件(提供源代码)
开发语言·python
hadage233
5 小时前
--- git 的一些使用 ---
开发语言·git·python
笨笨聊运维
11 小时前
CentOS官方不维护版本,配置python升级方法,无损版
linux·python·centos
Gerardisite
11 小时前
如何在微信个人号开发中有效管理API接口?
java·开发语言·python·微信·php
热门推荐
01GitHub 镜像站点02【保姆级教程】免费使用Gemini3的5种方法!免翻墙/国内直连03BongoCat - 跨平台键盘猫动画工具04UV安装并设置国内源05安娜的档案(Anna’s Archive) 镜像网站/国内最新可访问入口(持续更新)06Google Antigravity:无法登录?早期错误、登录修复和用户反馈指南07Linux下V2Ray安装配置指南08Spring Boot 4.0 发布总结:新特性、依赖变更与升级指南09全球最强模型Grok4,国内已可免费使用!(附教程)10Labelme从安装到标注:零基础完整指南