def get_pydoc_text(module):
 doc = pydoc.TextDoc()
 loc = (doc.getdocloc(pydoc_mod) or '')
 if loc:
  loc = (('\nMODULE DOCS\n    ' + loc) + '\n')
 output = doc.docmodule(module)
 patt = re.compile('\x08.')
 output = patt.sub('', output)
 return (output.strip(), loc)

def get_pydoc_text ( module ) : doc = pydoc . TextDoc ( ) loc = ( doc . getdocloc ( pydoc_mod ) or '' ) if loc : loc = ( ( '\nMODULE DOCS\n    ' + loc ) + '\n' ) output = doc . docmodule ( module ) patt = re . compile ( '\x08.' ) output = patt . sub ( '' , output ) return ( output . strip ( ) , loc )
returns pydoc generated output as text .