How do I compare files?

Timothy Grant timothy.grant at
Wed Jul 23 01:49:18 CEST 2008

On Tue, Jul 22, 2008 at 4:27 PM, Clay Hobbs <clay at> wrote:

> I am making a program that (with urllib) that downloads two jpeg files
> and, if they are different, displays the new one.  I need to find a way
> to compare two files in Python.  How is this done?
> -- Ratfink
> --

I'd start with file sizes.

If that's not enough you might look at the md5 library and check the md5
values for the files.

Stand Fast,
tjg. [Timothy Grant]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list