[Twisted-Python] How to emulate Python's getoutput function

Drake Smith drakesmith at adelphia.net
Fri Oct 7 23:04:01 EDT 2005


Is there a relatively simple way to emulate the following python function:
   commands.getoutput ('ifconfig eth0 | grep inet'))

I can get halfway there with:
   utils.getProcessOutput ('/sbin/ifconfig', ['eth0'])
but the trick to piping that output to another command such as grep is 
eluding me. Thank you.





More information about the Twisted-Python mailing list