[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to pipe from python script to system process that script starts



Kumar Appaiah wrote:
On Mon, Sep 03, 2007 at 08:05:16AM -0700, Freddy Freeloader wrote:
So far I've coded everything as process oriented rather than object oriented as that is what I am familiar with, but I'm beginning to believe that using classes is probably the way to go as it would be much easier to abstract concepts out that way. If someone has an example or two they could share with me on how to do interprocess piping in either oo or process oriented, or both, manner I would appreciate the help.

Read the documentation for os.popen. It opens the command and it's
stdin and stdout as pipes.

The commands module might also be of interest.

Kumar

Thanks.
I got os.popen4 to sort of work, I think, as it will capture stdout from the child process, but haven't figured out, yet, how to capture that and print it to the screen so I can read the headers.


Reply to: