title: Combinations of several dicts python
body: <p>I have 15 dicts like the following 3 (all 15 are of varying lengths).
  For example:</p>
  
  <pre><code> HQDict = {'HQ1':10, 'HQ2':3, 'HQ3':5}
   BADict = {'BA1':15, 'BA2':4, 'BA3':3}
   STDict = {'ST1':5, 'ST2':4, 'ST3':3}
  </code></pre>
  
  <p>I want to create all the possible combinations of the 15 dicts with only one element selected from each dict with the values added together and the keys stored in a list. I have been able to get all the information into the respective dicts but I am clueless on where to start with the combinations, I have seen itertools.combinations but I'm not sure how to make it only select 1 element from each dict. If you need any more information please ask and I will be happy to edit.</p>
  
  <p>Edit1:
  I also needed to add that the values are additive so value of BA2 will be the value of BA1 + BA2 and that the combination could be a list of 1.</p>
  
  <pre><code>list=[HQ1,BA2,ST1]
  value=34
  
  next permutation
  list=[HQ2]
  value=13
  </code></pre>
  
  <p>Edit2:</p>
  
  <p>Rather than try and create the combinations of the dicts the end goal is to give the function a total and it will return all the possible combinations of buildings (each dict represents a building and each item in the dict a level) that add up to that total. So for example:</p>
  
  <pre><code>combinations(34) would return
  [HQ1,BA2,ST1]
  and combinations(13 would return
  [HQ2]
  </code></pre>
  
  <p>pastebin to file containing all buildings and code im using to create the dicts : <a href="http://pastebin.com/jSUdS2Vu" rel="nofollow">link to pastebin</a></p>