title: Moving select file types to new directory based on dictionary
body: <p>I  am trying to move specific filetypes to a new directory based on a nested dictionary.</p>
  
  <p><strong>For example</strong>, (to separate video and photo files) move media files defined in <code>config[key1][other_file]</code> to <code>OTHERMEDIA</code> for each camera models in their respective folders:</p>
  
  <pre><code>001__=d5
      OTHERMEDIA                                   #move files to here
      IMAGES
          [mix of mediafiles in subdirectories]    #move files from here
  002__=alpha9
      OTHERMEDIA                                   #move files to here
      IMAGES
          [mix of mediafiles in subdirectories]    #move files from here
  </code></pre>
  
  <p><strong>Code</strong> gives <code>shutil.move(os.path.join(root,files), os.path.join(destinationpath,files))</code>. What I am doing wrong?</p>
  
  <pre><code>import shutil
  import os
  config = {
      'd5': {},
      'alpha9': {},
      'g7': {},
  }
  config['d5']['other_file'] = ('avi', 'AVI')
  config['alpha9']['other_file'] = ('jpg', 'JPG')
  config['g7']['other_file'] = ('mp4', 'MP4')
  
  destinationpath = 'OTHERMEDIA'
  root = os.getcwd()
  for camID in config:
      for dir in next(os.walk(root))[1]:
          if dir.endswith(camID):
              for path, dirs, files in os.walk(os.path.join(root, dir)):
                  for f in files:
                      if any([f.lower().endswith(x) for x in config[camID]["other_file"]]):
                          os.path.join(path, f). files, os.path.join(destinationpath,files)
  </code></pre>