一、difflib库的用法
a = '/Users/melon/Desktop/odoo14/myaddons/watermark_design/fonts/SimSun.ttf' b = '/Users/melon/Desktop/odoo14/myaddons/watermark_design/models/fonts/SimSun.ttf' from difflib import Differ d = Differ() diff = d.compare(a.splitlines(), b.splitlines()) print('\n'.join(list(diff)))