difflib.Differ

class difflib.Differ

This is a class for comparing sequences of lines of text, and producing human-readable differences or deltas. Differ uses SequenceMatcher both to compare sequences of lines, and to compare sequences of characters within similar (near-matching) lines.

Each line of a Differ delta begins with a two-letter code:

Code Meaning
'- ' line unique to sequence 1
'+ ' line unique to sequence 2
'  ' line common to both sequences
'? ' line not present in either input sequence

Lines beginning with ‘?‘ attempt to guide the eye to intraline differences, and were not present in either input sequence. These lines can be confusing if the sequences contain tab characters.

doc_python
2016-10-07 17:31:52
Comments
Leave a Comment

Please login to continue.