<p>初始化对象时调用<code>__init__()</code>方法。当你做-<code>Thread.__init__(self)</code>时,它只是调用父类<code>__init__()</code>方法。</p>
<p>如评论中所说,你可以删除它,功能应该保持不变。在您的类中,<code>__init__()</code>是完全多余的。</p>
<p>此方法在执行以下操作时调用-</p>
<pre><code>Example()
</code></pre>
<p>为<code>Example()</code>创建新对象时。</p>
<p>当对<code>Example()</code>对象执行-<code>.start()</code>操作时,将调用<code>run()</code>方法。这是通过<a href="https://docs.python.org/2/library/threading.html#threading.Thread" rel="nofollow">^{<cd9>}</a>方法完成的,从<a href="https://docs.python.org/2/library/threading.html#threading.Thread" rel="nofollow">documentation</a>-</p>
<blockquote>
<p><strong>start()</strong></p>
<p>Start the thread’s activity.</p>
<p>It must be called at most once per thread object. It arranges for the object’s run() method to be invoked in a separate thread of control.</p>
</blockquote>
<hr/>
<p>再添加一个print语句并将<code>Example().start()</code>分成两行,这样您就可以清楚地理解这一点-</p>
<pre><code>>>> from threading import Thread
>>> class Example(Thread):
... def __init__(self):
... Thread.__init__(self)
... print("In __init__")
... def run (self):
... print("It's working!")
...
>>> e = Example()
In __init__
>>> e.start()
It's working!
</code></pre>