I'm trying to do a text comparison via the 'difflib' library.
I was wondering how to JUST get the terms which are specific to the first string sequence vs the second.
Ex:
import difflib
one = "If rents are received later than five (5)"
two = "If rents are received later than eight (8)"
n_one = one.replace(" ","\n")
n_two = two.replace(" ","\n")
diff = difflib.ndiff(n_one.splitlines(1),n_two.splitlines(1))
print ''.join(diff)"
# ...
# - five
# - (5) + eight
# + 8
I was wondering how to get two strings:
-> Difference in first string:
['five','(5)']
--> Difference in second string:
['eight','(8)']