title: how to create range from a list of python dicts?
body: <p>I'm using openpyxl to evaluate a worksheet.
  There is one row on this worksheet contains column_group names in merged cells.
  i created a list of dicts where column_group is key and column number is value</p>
  
  <pre><code>col_groups= [{u'Layer': 1}, {u'Single Ended': 17},\
               {u'Single Ended': 22}, {u'Edge Coupled': 27}]
  </code></pre>
  
  <p>now I want to create a group_name:(start_column:end_column) dictionary using col_groups</p>
  
  <p>This is the closest I've been able to get.</p>
  
  <pre><code>group_cols = []
  for x, d in enumerate(col_groups):
      try:
          group_cols.append({col_groups[x].keys()[0]:(col_groups[x].values()[0],(col_groups[(x+1)].values()[0] - 1))})
      except:
          group_cols.append({col_groups[x].keys()[0]:(col_groups[x].values()[0],tap_sh.max_column)})
  </code></pre>
  
  <p>typing group_cols at the python shell prompt gives:</p>
  
  <p>[{u'Layer': (1, 16)}, {u'Single Ended': (17, 21)}, {u'Single Ended': (22, 26)}, {u'Edge Coupled': (27, 33)}]</p>
  
  <p>The output looks ok but my method feels a bit hackish- any suggestions to be more pythonic will be appreciated</p>