How to communicate between process in real time?
<p>I have two processes and the data of one process has to be communicated to the other. I wrote a basic queue in order to communicate in real time but it doesn't serve the purpose. </p>

<p>The following is example code:</p>

<pre><code>from multiprocessing import Process , Pipe , Queue
a , b = Pipe()
q = Queue()

def f(name):
i = 0
while i &lt; 4:
    q.put(i)
    i += 1


def t():
 print q.get()

if __name__ == '__main__':
 p = Process(target=f, args=('bob',))
 p.start()
 p.join()
 p1 = Process(target=t, args= (''))
 p1.start()
 p1.join()
</code></pre>

<p>The expected output was  <code>0 1 2 3 4</code>, but I only get <code>0</code>. 
How can I resolve this?</p>
