title: Randomly switch between lists but preserve order of the items
body: <p>I am creating a little script that will take a pickled file, read its contents and present it to the user. I am working on a feature that will allow to randomly select lists. Each list represents a single file. In these lists are items.</p>
  
  <p>What I want to do is randomly jump between files (master lists) but every time it returns to the file, I want to pick up where it left off - to read from the position it was at before.</p>
  
  <p>To demonstrate, I will give you a little example (in reality it's more complex):</p>
  
  <pre><code>master_list = [['one','two','three'],[1, 2, 3],['foo','bar','nothing']]
  </code></pre>
  
  <p>Now I want to do something like:</p>
  
  <pre><code>rand_master_list = random.choice(master_list)
  
  while True:
      for item in rand_master_list:
          print item
          break
  </code></pre>
  
  <p><em>The <code>break</code> statement is because I want to jump out of <code>for</code> loop so <code>rand_master_list</code> is differing from the one that was before.</em></p>
  
  <p>But I cannot do what I need. I would like to get this output for example:</p>
  
  <pre><code>one         # prints master_list[0][0]
  foo         # prints master_list[2][0]
  1           # prints master_list[1][0]
  bar         # randomly selects but it doesn't start with 'foo' but keeps
              # going in the list master_list[2][1]
  two         # print master_list[0][1] again notice the item order is
              # unchanged but the list containing items was randomly selected
  </code></pre>
  
  <p>Etc. You get the idea. I cannot figure out how to keep the state where the list was read last time. I hope it's not too confusing. Also, I do not know how <code>master_list</code> will look like, it will be changed every time so I cannot use anything too "specific", the number of the item lists in <code>master_list</code> will be different every time as well as number of items inside those.</p>