title: How to read file into dictionary in Python specific filetype
body: <p>Specifically, I have a text file with multiple lines arranged so that the key of each entry is the first line of a group, followed by its related values, followed by a newline before the next key.  I'm having a hard time using while loops to accomplish this with readline.</p>
  
  <p>For example the first line may be a restaurant name, followed by several lines of customers who ate there, which I then need to write into the values of a dictionary under the key of a restaurant name.</p>
  
  <p>I'm really unfamiliar with file reading so I'm afraid that what I have is not going to help at all really.</p>
  
  <p>Something like this I guess, but it's not even to the point of semi-functional.</p>
  
  <p>edit: Thanks for the response I should have clarified, each value item for a corresponding key is listed in subsequent lines after the key with the a blank line at the end of that list preceding the next key.  Also I am unfortunately compelled to use a readline approach here.</p>
  
  <pre><code>    restaurants = {}
      patrons = []
  
      line = file.readline()
      s = line.strip('\n')
  
      while s != ''
      restaurant = s
      line = file.readline
      patrons.append(s)
  </code></pre>