Best way to compare the contents of two directories

Robin Siebler robin.siebler at palmsource.com
Mon Sep 13 14:37:46 EDT 2004


"Raymond Hettinger" <vze4rx4y at verizon.net> wrote in message news:<Zxc1d.412$W73.185 at trndny03>...
> [Robin Siebler]
> > However, before I actually compare the files, I want to compare the
> > directories and if a directory is mising in either set, I want to
> > report it:
> 
> The operative word is "set".
> 
> Try using sets.py:
>      one_only = Set(dirlistone) - Set(dirlisttwo)
>      two_only = Set(dirlisttwo) - Set(dirlistone)
> 
> 
> Raymond Hettinger

I get the following error:

NameError: name 'Set' is not defined

I'm using ActivePython 2.2.3.  Is this something that has been added
to a later version of Python?



More information about the Python-list mailing list