|
123456789101112131415161718192021 |
- from threading import Thread
- from loguru import logger
-
-
- class Common(Thread):
-
- def __init__(self, content, func, args=()):
- super(Common, self).__init__()
- self.content = content
- self.func = func
- self.args = args
- self.result = None
-
- def get_result(self):
- self.join()
- return self.result
-
- def run(self):
- logger.info("开始执行线程!")
- self.result = self.func(self.args)
- logger.info("线程停止完成!")
|