def watcher(proc, delay):
    time.sleep(delay)
proc.kill()
proc = subprocess.Popen('python Slave.py', stdout=subprocess.PIPE)
threading.Thread(target=watcher, args=(proc, 3.0)).start()
data = bytearray()
while proc:
    chunk = proc.stdout.read(1)
if not chunk:
    break
data.extend(chunk)
print(data)
How to run a process with timeout and still get stdout at runtime