Redirecting stdout to another script

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?ISO-8859-1?Q?Richard_Sim=F5es?=

    Redirecting stdout to another script

    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
  • Diez B. Roggisch

    #2
    Re: Redirecting stdout to another script

    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

    Comment

    Working...