Redirecting stdout to another script

R

Richard Simões

Hopefully, this explanation will sufficiently clear despite the lack
of code.

I wrote a python script that takes data via stdin, does stuff with the
data, and outputs the result to stdout. A friend wrote a perl script
that opens a pipe to my script, feeds it data, and then accepts the
result. The problem here is that the python script's outputting the
result to stdout via print statements isn't doing what we expected: my
friend's perl script isn't getting the result back via the pipe.

Is there is simple solution for this problem? Whose script needs to be
modified?

Thanks,
Richard Simões
 
D

Diez B. Roggisch

Richard said:
Hopefully, this explanation will sufficiently clear despite the lack
of code.

I wrote a python script that takes data via stdin, does stuff with the
data, and outputs the result to stdout. A friend wrote a perl script
that opens a pipe to my script, feeds it data, and then accepts the
result. The problem here is that the python script's outputting the
result to stdout via print statements isn't doing what we expected: my
friend's perl script isn't getting the result back via the pipe.

Is there is simple solution for this problem? Whose script needs to be
modified?

That of your friend, if he is the one invoking you. Because the invoking
script is the one responsible for connecting the pipes properly.


Diez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top