Skip to content

Instantly share code, notes, and snippets.

@bulkan
Created August 3, 2011 01:33
Show Gist options
  • Save bulkan/1121692 to your computer and use it in GitHub Desktop.
Save bulkan/1121692 to your computer and use it in GitHub Desktop.
import subprocess
class MyOwnKeywords(object):
def run_cmd(self, cmd):
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
output = p.communicate()[0]
if p.wait() != 0:
print "*WARN* %s failed" %cmd
return output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment