holbertr at dma.org
Tue Oct 12 19:43:49 CEST 2004
The following example is based on code from The Standard Python Library:
if filecmp.cmp("folder1/file.ext", "folder2/another.ext"):
print "file contents are the same"
print "file contents differ"
Scott Carlson wrote:
> Still new to Python, but liking it.
> Using Windows.
> I create some files in a Temporary Folder while doing some work.
> Then, I want to look in a (different)Primary Folder to see if
> similarly named Files exist.
> If I find two Files with the same name, I want to know if the contents
> of the Files are exactly the same (I don't care about the date/time of
> the File).
> If they are different I want to move the new one into the Primary
> I'm thinking there's a nice concise way to do this.
> Scott Carlson
More information about the Python-list