[Twisted-Python] ProcessMonitor stderr stdout
Newbie question: I'm calling addProcess and everything works well, but I'm trying to understand how to capture/handle stderr stdout for that spawned process. -- Kevin McIntyre | Software Engineer | *Green Charge Networks* Cell 718-249-5058 | kmcintyre@greenchargenet.com | www.greenchargenet.com
On Feb 29, 2012, at 5:16 PM, Kevin McIntyre wrote:
Newbie question:
I'm calling addProcess and everything works well, but I'm trying to understand how to capture/handle stderr stdout for that spawned process.
Look into subclassing ProcessMonitor and override startProcess to provide your own ProcessProtocol. The default implementation uses a LoggingProtocol which just logs stdout from the process. The process howto should get you up to speed on what you can override in your ProcessProtocol (esp. outReceived() and errReceived()) http://twistedmatrix.com/documents/current/core/howto/process.html
On 12:16 am, kmcintyre@greenchargenet.com wrote:
Newbie question:
I'm calling addProcess and everything works well, but I'm trying to understand how to capture/handle stderr stdout for that spawned process.
I don't think you'll find a way to do this in the current version of the code. There are a couple open tickets for expanding ProcessMonitor to allow more control of this (and more): http://twistedmatrix.com/trac/ticket/194 http://twistedmatrix.com/trac/ticket/4440 It looks like the previous contributor may have moved on. Are you interested in working on this feature? Jean-Paul
participants (3)
-
exarkun@twistedmatrix.com
-
Kevin McIntyre
-
Lucas Taylor