title: Python and read text file that contains lists with strings and numbers
body: <p>This is a similar question to many but not quite the same.  I have a text file that has about 400,000 lines of text.  Each line is essentially a list.  For example it looks like <code>[ 'a','b',1,2,'c',3,'d and , e string', 45]</code></p>
  
  <p>I can read each line of the text file with the following code:</p>
  
  <pre><code>with open('myfile.txt') as f:
      content = f.readlines()
  </code></pre>
  
  <p>The problem is that each line is read as a string.  I would like to get each item of the list.  So i thought i would do (for each line):</p>
  
  <pre><code>content[line].split(',')
  </code></pre>
  
  <p>This almost works, but i run into a problem.  Many times in my text file i have a string in the list that has a comma in it (from above i had 'd and , e string').  I don't want this string split up but want it as one item.  </p>
  
  <p>If this doesn't make since I want to take the line from my text file <code>[ 'a','b',1,2,'c',3,'d and , e string', 45]</code> and i want 8 separate elements</p>
  
  <pre><code>'a'
  'b'
  1 
  2
  'c'
  3
  'd and , e string'
  45
  </code></pre>
  
  <p>Thanks for the help!</p>