title: Write list of list to file and then retrieve it from the file as a list of list
body: <p>I apologize for the confusing title, I am myself confused.</p>
  
  <p>Right now I am working on a program where I create a list whose elements are lists. I then write each element to a file. </p>
  
  <p>An example would be that I create list <strong>food</strong> with elements that are specific food items that are lists that contain information about the item itself.</p>
  
  <p>Right now my program will write each element of food to a file, for instance if I have </p>
  
  <pre><code>food = [banana, beans]
  </code></pre>
  
  <p>My output in food.txt will appear as</p>
  
  <pre><code>['Banana' , .54 , 'No' , 'Food']
  ['Beans' , 1.39, 'Yes', 'Food']
  </code></pre>
  
  <p>Where the first is the list <strong>banana</strong> and the second is the list <strong>beans</strong> from my list <strong>food</strong>. </p>
  
  <p>What I want is when I run the program again for these lists to be replaced into <strong>food</strong> before I do anything else. I know that I can create a list from a file by</p>
  
  <pre><code>inFile.readline()
  </code></pre>
  
  <p>However, this does not seem to yield the correct result. Therefore, my question is how to read the lists from the file and put them back in my <strong>food</strong> list exactly as they were before I closed the program. Thank you for any help!</p>