Jonathan Ellis wrote:

>That's a sar message.  Apparently it doesn't like being run as a
>subprocess, for some reason.
>
>The commands module is kind of old and busted.  Use subprocess instead,
>which allows you to get stdout unmingled with stderr:
>
>import subprocess
>p = subprocess.Popen('sar 0 |grep -v foo', shell=True,
>stdout=subprocess.PIPE, stderr=subprocess.PIPE)
>p.stdout.read()
>  
>
Thanks much this worked perfectly.

>(The UPyUG's october meeting will cover "python for sysadmins:"
>http://utahpython.org.)
>
I'll be there

Mitch

/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Reply via email to