finding and listing the differences between two files

Thomas Wouters thomas at xs4all.net
Mon Mar 12 09:07:46 EST 2001


On Sat, Mar 10, 2001 at 04:35:34PM +0000, Cliff Crawford wrote:
> * Chris Richard Adams <chrisa at ASPATECH.COM.BR> menulis:
> | 
> | Anyone know the equivalent in Python or am I better off sticking to
> | shell.

> 2.1 has a module called "difflib" which you can use.  Also, a diff
> program written in Python comes with the Python source
> (Tools/scripts/ndiff.py).

Note that ndiff is 'not	quite normal diff' (hence the 'n'.) It is quite
superior if you want 'readable' diffs, and if you want to spot subtle
changes, though.

Note that ndiff is 'not quite normal diff' (hence the 'n',) It is quite
superior if you want 'readable' diffs, and if you want to spot sublte
changes, though. 

(And here's the ndiff of the above two almost identical pieces ;)

- Note that ndiff is 'not quite normal diff' (hence the 'n'.) It is quite
?                                                          ^              
+ Note that ndiff is 'not quite normal diff' (hence the 'n',) It is quite
?                                                          ^              
- superior if you want 'readable' diffs, and if you want to spot subtle
?                                                                    -
+ superior if you want 'readable' diffs, and if you want to spot sublte
?                                                                   +
- changes, though.
+ changes, though. 
?                 +

-- 
Thomas Wouters <thomas at xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!




More information about the Python-list mailing list