Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

check files for equality [duplicate]

what's the most elegant way to check to files for equality in Python? Checksum? Bytes comparing? Think files wont' be larger than 100-200 MB

like image 534
illegal-immigrant Avatar asked Nov 26 '10 08:11

illegal-immigrant


1 Answers

What about filecmp module? It can do file comparison in many different ways with different tradeoffs.

And even better, it is part of the standard library:

http://docs.python.org/library/filecmp.html

like image 106
wump Avatar answered Sep 23 '22 20:09

wump