Jan-22-2024, 12:56 PM
From the difflib documentation:
Quote:compare(a, b)It may be slightly inconvenient, but at least it tells you up front.
Compare two sequences of lines, and generate the delta (a sequence of lines).
Each sequence must contain individual single-line strings ending with newlines. Such sequences can be obtained from the readlines() method of file-like objects. The delta generated also consists of newline-terminated strings, ready to be printed as-is via the writelines() method of a file-like object.