Diff of Text

GZ zyzhu2000 at gmail.com
Fri Jun 4 17:51:39 EDT 2010


Hi Pat,

On Jun 4, 2:55 pm, Patrick Maupin <pmau... at gmail.com> wrote:
> On Jun 3, 9:54 pm, GZ <zyzhu2... at gmail.com> wrote:
>
> > Hi All,
>
> > I am looking for an algorithm that can compare to source code files
> > line by line and find the minimum diff. I have looked at the difflib
> > included in python. The problem is that it is designed to make the
> > diff results easier for humans to read, instead of minimize the size
> > of the output differencial. I would like an algorithm implementation
> > that gives the absolute minimum difference between the two files.
>
> > Can you help me?
>
> > Thanks,
> > gz
>
> There's an "rsync.py" module in pypi -- one would think that would
> have to solve that same problem...
>
> Regards,
> Pat

No, rsync does not solve my problem.

I want a library that does unix 'diff' like function, i.e. compare two
strings line by line and output the difference. Python's difflib does
not work perfectly for me, because the resulting differences are
pretty big. I would like an algorithm that generates the smallest
differences.



More information about the Python-list mailing list