I have a C program which calls fork()
And I have a python script which executes the C program with
child = subprocess.Popen(command, shell=True, stderr=subprocess.PIPE,stdout=subprocess.PIPE, bufsize=0)
Now I can read from stdout and stderr with child.stderr.read(1)
or child.communicate()
, ... But my problem is now, how can I get only the output from the forked process. Is this even possible? Can I get the pid from both, the original C program and the fork?
kind regards, thank you very much :)
Fabian