Any way to adjust difflib algorithm?
invalid at invalid
Fri Aug 14 20:38:27 CEST 2009
I'm trying to use difflib to compare two files, and it's not
producing very useful results. When comparing two lines where
only a few characters have changed, it usually seems to decide
that a line was deleted/inserted/replaced rather than changed.
Here's how I'm using it:
fromlines = [l.rstrip('\n') for l in open(sys.argv).readlines()]
tolines = [l.rstrip('\n') for l in open(sys.argv).readlines()]
In my particular usage, no lines have ever been
inserted/deleted, so perhaps I should be running diffs on
individual lines instead? If I do that, I can't figure out how
to generate HTML output.
Is there a way to tell the differ to try harder to match lines?
Grant Edwards grante Yow! I hope something GOOD
at came in the mail today so
visi.com I have a REASON to live!!
More information about the Python-list