# HG changeset patch # User Joseph Turian # Date 1214960964 14400 # Node ID faece52be094ae462249ea896a0730585c20121c # Parent 2291a244a887369785983b082b100604d5023f66 Added common.misc.runcmd diff -r 2291a244a887 -r faece52be094 common/misc.py --- a/common/misc.py Thu Jun 19 16:27:02 2008 -0400 +++ b/common/misc.py Tue Jul 01 21:09:24 2008 -0400 @@ -1,3 +1,11 @@ +def runcmd(cmd): + """ + Run a command and return its output + """ + import popen2 + (pin, pout) = popen2.popen2(cmd) + return pin.read() + def sign(i, assertions=True): """ + or - 1