def _writedoc(doc, thing, forceload=<NUM_LIT:0>):
try:<EOL><INDENT>object, name = pydoc.resolve(thing, forceload)<EOL>page = pydoc.html.page(pydoc.describe(object), pydoc.html.document(object, name))<EOL>fname = os.path.join(doc, name + '<STR_LIT>')<EOL>file = open(fname, '<STR_LIT:w>')<EOL>file.write(page)<EOL>file.close()<EOL><DEDENT>except (ImportError, pydoc.ErrorDuringImport) as value:<EOL><INDENT>traceback.print_exc(sys.stderr)<EOL><DEDENT>else:<EOL><INDENT>return name + '<STR_LIT>'<EOL><DEDENT>
Write HTML documentation to a file in the current directory.