title: How to do implement a paging solution with a dict object in Python
body: <p>Is there a better way to implement a paging solution using <code>dict</code> than this?</p>
  <p>I have a <code>dict</code> with image names and URLs.
  I need to 16 key value pairs at a time depending on the user's request, i.e. page number.
  It's a kind of paging solution.
  I can implement this like:</p>
  <p>For example :</p>
  <pre><code>dict = {'g1':'first', 'g2':'second', ... }
  </code></pre>
  <p>Now I can create a mapping of the keys to numbers using:</p>
  <pre><code>ordered={}
  
  for i, j in enumerate(dict):
      ordered[i]=j
  </code></pre>
  <p>And then retrieve them:</p>
  <pre><code>dicttosent={}
  
  for i in range(paegnumber, pagenumber+16):
    dicttosent[ordered[i]] = dict[ordered[i]]
  </code></pre>
  <p>Is this a proper method, or will this give random results?</p>