比较两个字符串并在python中的html中的两个字符串之间并排返回差异

时间:2021-06-23 13:41:39

标签: python

现在我在 Python 中使用 difflib 来生成不同的 html,

import difflib

htmlcontent = 
difflib.HtmlDiff(wrapcolumn=60).make_file(
        file_1, file_2, old_file.name, new_file,context=True)

with open(output_file, "w", encoding="utf8", errors='ignore') as f:
            f.write(htmlcontent)

问题 UI 不吸引人(UI 将从基于 diff 的 html 文件呈现)。任何使用户界面更具吸引力的建议。或任何其他 python 库是否可以返回包含差异的 html 模板,以及具有吸引力的用户界面,例如在线差异检查器?

0 个答案:

没有答案