0x01 线程基础
线程创建
直接创建线程对象
import time
import threading
def count_down(n):
while n > 0:
print("T-minus", n)
n -= 1
time.sleep(1)
t = threading.Thread(target=count_down, args=(9,))
t.start()
t.join()继承Thread类
守护线程
创建时设置
设置线程对象属性
线程对象属性和方法
threading包其他方法
最后更新于