On 2009-08-19, Aahz <a...@pythoncraft.com> wrote: > In article <fmqdncomnpg-jrjxnz2dnuvz_tti4...@posted.visi>, > Grant Edwards <inva...@invalid> wrote: >>On 2009-08-14, Grant Edwards <inva...@invalid> wrote: >>> >>> 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. >> >>I ended up using the SequenceMatcher on individual pairs of >>lines and generating my own HTML based on the results of >>get_matching_blocks(). >> >>That produced the desired results. > > Good work! Note that IME most diff software shows changed > lines as a delete-and-add. For example, diff -u
Right -- though difflib did show _some_ lines as changed rather than deleted/added, it wasn't obvious how it decided between the two. I suspect it used some sort of percentage-changed threshold. For this application both files had all the same lines (by definition), so what I was interested in was what parts of each line changed. -- Grant Edwards grante Yow! I just heard the at SEVENTIES were over!! And visi.com I was just getting in touch with my LEISURE SUIT!! -- http://mail.python.org/mailman/listinfo/python-list