美文网首页
python __init__ 的使用

python __init__ 的使用

作者: 小网管 | 来源:发表于2018-08-22 13:46 被阅读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

相关文章

网友评论

      本文标题:python __init__ 的使用

      本文链接:https://www.haomeiwen.com/subject/cxzeiftx.html