Skip to content

Instantly share code, notes, and snippets.

@binarytemple
Created July 1, 2015 10:21
Show Gist options
  • Select an option

  • Save binarytemple/b2f50a44ca5e4acf8548 to your computer and use it in GitHub Desktop.

Select an option

Save binarytemple/b2f50a44ca5e4acf8548 to your computer and use it in GitHub Desktop.
simple example of using python difflib
from difflib import *

hd=HtmlDiff()

l1= open("/tmp/foo.md",'rb').readlines()
l2= open("/tmp/foo2.md",'rb').readlines()

out = hd.make_file(l1,l2,"before","after")
open('/tmp/res.html','wb').write(out)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment