difflib confusion

Paul Hankin paul.hankin at gmail.com
Tue Jan 22 23:33:43 CET 2008

On Jan 22, 6:57 pm, "krishnakant Mane" <researchb... at gmail.com> wrote:
> hello all,
> I have a bit of a confusing question.
> firstly I wanted a library which can do an svn like diff with two files.
> let's say I have file1 and file2 where file2 contains some thing which
> file1 does not have.  now if I do readlines() on both the files, I
> have a list of all the lines.
> I now want to do a diff and find out which word is added or deleted or changed.
> and that too on which character, if not at least want to know the word
> that has the change.
> any ideas please?

Have a look at difflib in the standard library.

Paul Hankin

More information about the Python-list mailing list