#!/usr/bin/env python # vim: softtabstop=4 shiftwidth=4 expandtab import os from subprocess import * p = Popen('service cpboot start',shell=True, stderr=PIPE, stdout=PIPE) output = p.communicate() print 'STDERR: %s' % output[0] print 'STDOUT: %s' % output[1]