title: Iterating through dictionary list to search through directory to find files and copy them to new location
body: <p>I am relatively new to Python and having trouble figuring out what i am missing in my code.  What i am attempting to do is to create a dictionary containing a list of values and then use that dictionary to search a directory for file names then copy those files to a new folder (named after the key, which is already created). The key is a contract name and the values are contract plan sheets so each contract has anywhere 2 to 100 sheets. I got the code to work when each key only had one value, but now that it is a list it does not work. Any help would be greatly appreciated!</p>
  
  <p>I am using <code>arcpy.da.searchcursor</code> to append the values to a dictionary.<br>
  Then i am using <code>itervalues</code> to iterate through the dictionary values i get the error<br>
  <code>ValueError: too many values to unpack.</code></p>
  
  <pre><code>recDCT = {}
  with arcpy.da.SearchCursor (deviceFC, [contract, RECDOC]) as curs:
      for row in curs:
          if row[1] &lt;&gt; None and row[0] &lt;&gt; None:
              if row[0] in recDCT.keys():
                  recDCT[row[0]].append(row[1])
              else:
                  recDCT[row[0]] = [row[1]]
  
  for root, dirs, files in os.walk(path):
      for key, value in recDCT.itervalues():
          if value in files:
              shutil.copy(os.path.abspath(root + '/' + value), os.path.abspath(outLoc + '/' + key))
  
  </code></pre>
  
  <p>I expect the script to copy the all of the files for that key into the specified folderfile to the new folder.</p>
  
  <p>**Update, figured out the solution I needed to use a <code>for</code> loop to call each key before iterating through the list.</p>
  
  <pre><code>recDCT = {}
  with arcpy.da.SearchCursor (deviceFC, [contract, CurrDP]) as curs:
      for row in curs:
          if row[1] is not None and row[0] is not None:
              if row[0] in recDCT.keys():
                  recDCT[row[0]].append(row[1])
              else:
                  recDCT[row[0]] = [row[1]]
  
  for root, dirs, files in os.walk(path):
      for key in recDCT:
          for value in recDCT[key]:
              if value in files:
                  shutil.copy(os.path.abspath(root + '/' + value), os.path.abspath(outLoc + '/'+ key))
                  a += 1
              else:
                  pass
  </code></pre>