Форум сайта python.su
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))
Офлайн