Advertisement
Guest User

Untitled

a guest
Dec 10th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. #!usr/bin/env python
  2. from __future__ import absolute_import, division, print_function, unicode_literals
  3.  
  4. import subprocess
  5.  
  6.  
  7. p = subprocess.Popen(
  8.     ['python2.7', 'slave.py'],
  9.     stdin=subprocess.PIPE,
  10.     stdout=subprocess.PIPE,
  11. )
  12.  
  13. while True:
  14.     p.stdin.write("0\n")
  15.     p.stdin.flush()
  16.     response = p.stdout.readline().strip()
  17.     print("main get {}".format(response))
  18.     if int(response) == 0:
  19.         break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement