The filecmp module

(New in 2.0) This module contains functions to compare files and directories.

Example: Using the filecmp module
# File:

import filecmp

if filecmp.cmp("samples/", "samples/sample.wav"):
    print "files are identical"
    print "files differ!"

files differ!

In 1.5.2 and earlier, you can use the cmp and dircmp modules instead.


A Django site. rendered by a django application. hosted by webfaction.