You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 satır
502B

  1. from threading import Thread
  2. from loguru import logger
  3. class Common(Thread):
  4. def __init__(self, content, func, args=()):
  5. super(Common, self).__init__()
  6. self.content = content
  7. self.func = func
  8. self.args = args
  9. self.result = None
  10. def get_result(self):
  11. self.join()
  12. return self.result
  13. def run(self):
  14. logger.info("开始执行线程!")
  15. self.result = self.func(self.args)
  16. logger.info("线程停止完成!")