python __init__ 的使用

import threading
import time

class myThread(threading.Thread):    #定义子类,类继承
    def __init__(self, name, delay):
        threading.Thread.__init__(self) #通过父类的init()函数构造
        self.name = name
        self.delay = delay

你可能感兴趣的:(python __init__ 的使用)