title: Lists to dictionary but with multiple values for each key
body: <p>Im gathering the following data filenames, usernames and passwords. This data is being gathered by traversing each dir looking for documents(scripts mostly) with credentials in clear text. The idea is to gather evidence of bad practices being followed by system admins.</p>
  
  <p>The my script does this well enough, however I am trying to understand the best way to handle the data. Id like to place the filename and credentials found in that particular file into a dictionary. So the key being the filename and the values being the credentials found in that file. </p>
  
  <p>Ive worked out how to add data to dictionaries but im not entirely sure how to and cant find a way to get 2 lists into a dictionary and the dictionary hosting multiple values for 1 key. Any pointers would be appreciated. The line with <code>#if not m: add non matched data to un_matched list</code> is currently not used, as suggested by the comment. Id like to add non matched data to another list (for debugging)</p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>dirt = "~/Desktop/tmp"
  
  def get_files():
      regs = ["(.*)((U|u)ser(.*))(\s=\s\W\w+\W)", "(.*)((U|u)ser(.*))(\s=\s\w+)", "(.*)((P|p)ass(.*))\s=\s(\W(.*)\W)", "(.*)((P|p)ass(.*))(\s=\s\W\w+\W)"]
      combined = "(" + ")|(".join(regs) + ")"
      cred_results = []
      creds = []
      un_matched = []
      filesfound = []
      for root, dirs, files in os.walk(dirt):
          for filename in files:
              if filename.endswith(('.bat', '.vbs', '.ps', '.txt')):
                  readfile = open(os.path.join(root, filename), "r")
                  for line in readfile:
                      m = re.match(combined, line)
                      if m:
                          creds.append(m.group(0))    
                     #if not m: add non matched data to un_matched list
                  filesfound.append(os.path.join(root, filename)) 
                  cred_results = [line.rstrip() for line in creds]
  
      print cred_results
      print filesfound
  </code></pre>
  
  <p><strong>Current Ouput from script</strong></p>
  
  <pre><code>['strUser = "guytom"', 'strPassword = "P@ssw0rd1"', 'strUsername = "guytom2"', 'strPass = "SECRETPASSWORD"']
  ['~/Desktop/tmp/Domain/Policies/{31B2F340-016D-11D2-945F-00C04FB984F9}/USER/Scripts/Logon/logonscript1.vbs', '~/Desktop/tmp/Domain/Policies/{31B2F340-016D-11D2-945F-00C04FB984F9}/USER/Scripts/Logon/logonscript2.bat']
  </code></pre>