'Execute a command using popen
returns: out, err, exitcode'

def pexec(self, *args, **kwargs):

    popen = self.popen(stdin=PIPE, stdout=PIPE, stderr=PIPE, *args, **kwargs)
    (out, err) = popen.communicate()
    exitcode = popen.wait()
    return (out, err, exitcode)
