The cmp module

(Obsolete, only in 1.5.2). This module contains a function to compare two files.

Example: Using the cmp module
# File: cmp-example-1.py

import cmp

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

files differ!

In Python 2.0 and later, this module has been replaced by the filecmp module.

 

[comment on/vote for this article]

A Django site. this page was rendered by a django application in 0.02s 2010-09-02 15:29:08.562227. hosted by webfaction.