#!/usr/bin/env python
import difflib
import sys
try:
tx1 = sys.argv[1]
tx2 = sys.argv[2]
except Exception as e:
print "error" + str(e)
print "usage: xx filename1 filename2"
sys.exit()
def readf(fn):
try:
fileH = open(fn, 'rb')
text = fileH.read().splitlines()
fileH.close()
return text
except Exception as e:
print "error: " + str(e)
system.exit()
if name == "main":
tx1_line = readf(tx1)
tx2_line = readf(tx2)
d = difflib.HtmlDiff()
print d.make_file(tx1_line,tx2_line)