Well, I have two scripts. The a.py which prints the output of the b.py script as follows:
#a.py from subprocess import Popen, PIPE, STDOUT p = Popen(['/Users/damian/Desktop/b.py'], shell=False, stdout=PIPE, stderr=STDOUT) while p.poll() is None: print p.stdout.readline() #b.py #!/usr/bin/env python import time while 1: print 'some output' #time.sleep(1) This works.But, Why do my scripts deadlock when I uncomment the time.sleep() line?