It has always pretty easy for me to read from and write to pipes in python, assuming you are talking about /std(out|in|err)/.
from sys import stdin, stdout, stderr
for n,line in enumerate(stdin):
stdout.write(str(n) + '\n')
stderr.write(line)
Is that the kind of reading and writing you are talking about?