Redirecting stdout to another script

Diez B. Roggisch deets at nospam.web.de
Wed Jul 16 09:05:58 CEST 2008


Richard Simões schrieb:
> 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



More information about the Python-list mailing list