title: Parse CSV containing list in a column
body: <p>I have a CSV file that I generated through a <a href="http://docs.python.org/2/library/csv.html#csv.writer" rel="nofollow"><code>csv.writer</code></a> object. Here is a simplified version of the code to generate the file:</p>
  
  <pre><code>output = open('out.txt', 'ab+')
  writer = csv.writer(output, dialect='excel')
  
  for item in dataset:
      row = []
      row.append(item['id'])
      row.append(item['timestamp'])
  
      values = []
      for value in item['values']
          values.append(value['name'])
      row.append(values)
  
      writer.writerow(row)
      output.flush()
  
  output.close()
  </code></pre>
  
  <p>A sample row in the CSV file looks like this:</p>
  
  <pre><code>457458856894140182,Mon Dec 02 11:36:48 +0000 2013,[u'Sugar', u'Rice', u'Bleach']
  </code></pre>
  
  <p>I've tried using a <a href="http://docs.python.org/2/library/csv.html#csv.reader" rel="nofollow"><code>csv.reader</code></a> object to parse the  data back into another script, but haven't been able to correctly parse the list in the third column. Python just sees the entire value <code>[u'Sugar', u'Rice', u'Bleach']</code> as a string. For example, the code:</p>
  
  <pre><code>input = open('out.txt', 'rb')
  reader = csv.reader(input, dialect='excel')
  
  for row in reader:
      print row[2][0]
  
  input.close()
  </code></pre>
  
  <p>...just outputs a long list of <code>[</code> on newlines.</p>
  
  <p>How can I parse this CSV file correctly, to get assemble the structure in the third column back into a list in memory?</p>