一、普通线程设置 import threading class Foo(object): def __init__(self): # 初始化线程号是0 self.name = 0 # 实例化Foo类 local_values = Foo() # def func(num): # 线程号传参 local_values.name = num