(Obsolete, Only in 1.5.2) The dircmp module provides a class that can be used to compare the contents of two disk directories, as Example 14-18 shows.
dircmp
Example 14-18. Using the dircmp Module
File: dircmp-example-1.py import dircmp d = dircmp.dircmp() d.new("samples", "oldsamples") d.run() d.report() diff samples oldsamples Only in samples : ['sample.aiff', 'sample.au', 'sample.wav'] Identical files : ['sample.gif', 'sample.gz', 'sample.jpg', ...]
diff samples oldsamples
Only in samples : ['sample.aiff', 'sample.au', 'sample.wav']
Identical files : ['sample.gif', 'sample.gz', 'sample.jpg', ...]
In Python 2.0 and later, this module has been replaced by filecmp.
filecmp
3.147.58.194