def run_pydoc(module_name, *args):
    """
    Runs pydoc on the specified module. Returns the stripped
    output of pydoc.
    """
    cmd = [sys.executable, pydoc.__file__, " ".join(args), module_name]
    output = subprocess.Popen(cmd, stdout=subprocess.PIPE).stdout.read()
    return output.strip()