Created
March 27, 2011 18:28
-
-
Save kracekumar/889439 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#child.py | |
#! /usr/bin/env python | |
import subprocess | |
import sys | |
try: | |
processes=int(raw_input("NO of child process:")) | |
pid_list=[] | |
for x in xrange(processes+1): | |
text="echo " + str(x) | |
echo=subprocess.Popen(text,stdout=subprocess.PIPE,shell=True,stdin=subprocess.PIPE) | |
spawned_process=subprocess.Popen(["python"," get_input.py"],shell=True,stdin=echo.stdout,stdout=subprocess.PIPE) | |
pid_list.append(spawned_process.pid) | |
print spawned_process.stdout.readline() | |
# print pid_list | |
# sys.stdin.write(pid_list) | |
except ValueError: | |
print "expects int " | |
#get_input.py | |
#! /usr/bin/env python | |
import sys | |
k=raw_input() | |
k=sys.stdin.readlines() | |
print "krace" | |
print k | |
the problem is i am unable to get get_input.py o/p |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment