mythread.py
416 Bytes
# -*- coding: utf-8 -*-
# @Time : 2020/12/21 14:23
# @Author : Young Lee
# @Email : young_lee2017@163.com
from threading import Thread
class MyThread(Thread):
def __init__(self, func, *args):
super(MyThread, self).__init__()
self.func = func
self.args = args
def run(self):
self.result = self.func(*self.args)
def get_result(self):
return self.result