title: Python name variable from string
body: <p>Is it possible to create a variable name based on the value of a string?</p>
  
  <p>I have a script that will read a file for blocks of information and store them in a dictionary.  Each block's dictionary will then be appended to a 'master' dictionary.  The number of blocks of information in a file will vary and uses the word 'done' to indicate the end of a block.</p>
  
  <p>I want to do something like this:</p>
  
  <pre><code>master={}
  block=0
  for lines in file:
    if line != "done":
      $block.append(line)
    elif line == "done":
      master['$block'].append($block)
      block = block + 1
  </code></pre>
  
  <p>If a file had content like so:</p>
  
  <pre><code>eggs
  done
  bacon
  done
  ham
  cheese
  done
  </code></pre>
  
  <p>The result would be a dictionary with 3 lists:</p>
  
  <pre><code>master = {'0': ["eggs"], '1': ["bacon"], '2': ["ham", "cheese"]}
  </code></pre>
  
  <p>How could this be accomplished?</p>