Generate pretty diff html in Python

后端 未结 7 599
日久生厌
日久生厌 2020-12-02 07:50

I have two chunks of text that I would like to compare and see which words/lines have been added/removed/modified in Python (similar to a Wiki\'s Diff Output).

I ha

7条回答
  •  爱一瞬间的悲伤
    2020-12-02 08:34

    I recently posted a python script that does just this: diff2HtmlCompare (follow the link for a screenshot). Under the hood it wraps difflib and uses pygments for syntax highlighting.

提交回复
热议问题