#如'abbcc','abbdd' 找到abb
a='abbcc'
b='abbdd'
from difflib import *
s=SequenceMatcher(None,a,b)
m=s.find_longest_match(0,len(a),0,len(b))
print a[m.a:m.a+m.size]

05-07 15:46