title: Delete duplicated files using python
body: <p>I am trying to delete duplicated files on my disk but I'm stuck. </p>
  
  <p>I made a new class containing 3 fields: path, size and filename:</p>
  
  <pre><code>class photo:
     def __init__(self, path, size):
        self.path = re.sub(r'.*\\', '', path)
        self.size = size
        self.hash = self.path+self.size
     def getTitle(self):
         return (self.path)
     def getSize(self):
         return (self.size)
     def getHash(self):
         return (self.hash)
  </code></pre>
  
  <p>Then, I add all files to a list:</p>
  
  <pre><code>for path, subdirs, files in os.walk(root):
  for name in [f for f in files if f.endswith(".jpg")]:
     title = os.path.join(path, name)
     size = str(os.path.getsize(os.path.join(path, name)))
     photo_list.append(photo(title, size))
  </code></pre>
  
  <p>All I need now is to extract duplicated files, for example when I have something like this:
  c:\example.jpg
  c:\subdir\example.jpg</p>
  
  <p>I need to extract this to some other list like duplicated_list, in the next step I will choose which one I delete.</p>