Python - thread inheritance's method (func)
<p>I have class A which inheritance the class B
i need to send main_b to thread and continue with the program (main_a)</p>

<pre><code>import threading
import time

class B(object):

    def main_b(self):
        i = 0
        while i &lt; 5:
            print "main_b: %s" %time.ctime(time.time())
            time.sleep(1)
            i += 1

class A(B):

    def main_a(self):
        b = threading.Thread(target=self.main_b())
        b.start()
        i = 0
        while i &lt; 5:
            print "main_a: %s" %time.ctime(time.time())
            time.sleep(1)
            i += 1
        b.join()

aa = A()
aa.main_a()
</code></pre>

<p>Expected result main_b and main_a print at same time</p>

<p>Actual:</p>

<p>main_b: Thu Sep 22 09:57:44 2016</p>

<p>main_b: Thu Sep 22 09:57:45 2016</p>

<p>main_b: Thu Sep 22 09:57:46 2016</p>

<p>main_a: Thu Sep 22 09:57:47 2016</p>

<p>main_a: Thu Sep 22 09:57:48 2016</p>

<p>main_a: Thu Sep 22 09:57:49 2016</p>

<p>Just pass method as a target for thread:</p>

<pre><code>b = threading.Thread(target=self.main_b)
</code></pre>

python multithreading