difflib.HtmlDiff()
difflib.HtmlDiff() is a Python function in the Difflib Module category. Produces an HTML table showing side-by-side comparison. The syntax is difflib.HtmlDiff(tabsize=8, wrapcolumn=None, linejunk=None, charjunk=None). Returns: HtmlDiff object. A typical example: hd = difflib.HtmlDiff()
html = hd.make_file(old_lines, new_lines). A close sibling is difflib.SequenceMatcher(), which flexible sequence comparison object. Finds the longest matching subsequences. A close sibling is difflib.get_close_matches(), which returns the best `n` matches for a word from a list of possibilities. A close sibling is difflib.unified_diff(), which compares two sequences and produces a unified diff output (like diff -u). A close sibling is difflib.context_diff(), which compares sequences and produces a context diff (like diff -c). More about this category: Sequence comparison — SequenceMatcher, get_close_matches, unified_diff. For a broader walkthrough, read the Difflib Module guide. Related Difflib Module entries: difflib.SequenceMatcher(), difflib.get_close_matches(), difflib.unified_diff(), difflib.context_diff(), difflib.ndiff(). This page is part of the free Python Reference documentation covering 978+ functions, methods, and modules with examples and parameter details.