python __init__ 的使用
2018-08-22 本文已影响0人
小网管
import threading
import time
class myThread(threading.Thread): #定义子类,类继承
def __init__(self, name, delay):
threading.Thread.__init__(self) #通过父类的init()函数构造
self.name = name
self.delay = delay