string1 = """ one two 3 """ string2 = """ one ttttttt 3 """
Что то накак не могу разобраться с этим difflib.
string1 = """ one two 3 """ string2 = """ one ttttttt 3 """
#!/usr/bin/env python #-*- coding: utf8 -*- import difflib string1 = """ one two 3 """.splitlines() string2 = """ one ttttttt 3 """.splitlines() diff = list(difflib.ndiff(string1, string2)) print '\n'.join(difflib.restore(diff, 2))