Unix diff algorithm in Python anyone?

Dan Schmidt dfan at harmonixmusic.com
Wed Oct 6 09:58:00 EDT 1999


harri.pasanen at trema.com writes:

| I made some effort to track down a python module that could be used as
| unix diff.  Currently I'm in fact popen'ing diff itself, but for I'd
| like to have a self-contained utility.
| 
| I'm not comparing big files, so a Python only solution will probably be
| fast enough.
| 
| Failing a ready solution, can someone perhaps point me to a description
| of the algorithm, so I could implement it myself.

If you know Perl too, you should look at
<http://www.plover.com/~mjd/perl/diff/>, where Mark-Jason Dominus has
implemented the diff algorithm in that language.  Translating it into
Python should be straightforward.

-- 
Dan Schmidt | http://www2.thecia.net/users/dfan/




More information about the Python-list mailing list