Python--线程样式
来源:互联网 发布:新手怎么学好网络优化 编辑:程序博客网 时间:2024/06/18 14:14
#-*- coding:utf-8 -*-from threading import Threadfrom time import sleepclass MyThread(Thread): def run(self): for i in range(1, 100, 1): print(i) sleep(100)def daemon(n): for i in range(1, n, 1): sleep(100) print(i)def main(): #守护线程,当主线程和 线程t运行完,程序终止,不会等 thread 运行 thread = MyThread() thread.setDaemon(True) thread.start() #非守护线程 程序需要等 t运行完成才退出 t = Thread(target=daemon, args=(100,)) t.start() print("main")main()
0 0
- Python--线程样式
- Python--线程样式
- Google样式 for python
- Python Module_openpyxl_styles 样式处理
- python idle更改样式
- python 图表plot样式
- python线程
- python线程
- python线程
- python 线程
- Python线程
- Python线程
- python 线程
- python线程
- Python 线程
- python线程
- 【Python】线程
- 【Python】 python线程指南
- Android开发学习-4
- 夜深人静时
- 黑马程序员_Java基础_IO流_字节流,字节流操作文件,缓冲区字节流,流的使用规律,异常记录原理
- 黑马程序员_关于字符串缓冲池
- 重建控制文件的语法
- Python--线程样式
- java收集内存堆栈信息命令
- openwrt luci 实现框架
- NGINX模块开发 之 验证URL参数
- UVa 10033 - Interpreter
- 用JS获取地址栏参数的方法(超级简单)
- 新手必看,关于ARM的22个常用概念!
- 具体化生活
- 在 Eclipse 中结合 IBM WebSphere Application Server 使用