这里使用Python多线程的threading模块,threading模块的Thread是可被继承的类。我们可以采用继承的方法实现多线程异步执行。
import threading
import time
class TestTask(threading.Thread):
def __init__(self, value):
super().__init__()
这里使用Python多线程的threading模块,threading模块的Thread是可被继承的类。我们可以采用继承的方法实现多线程异步执行。
import threading
import time
class TestTask(threading.Thread):
def __init__(self, value):
super().__init__()