Mercurial > pylearn
changeset 358:faece52be094
Added common.misc.runcmd
author | Joseph Turian <turian@iro.umontreal.ca> |
---|---|
date | Tue, 01 Jul 2008 21:09:24 -0400 |
parents | 2291a244a887 |
children | 9e73e6dc9823 |
files | common/misc.py |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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