title: How to Convert a Text File into a List in Python
body: <p>I'm having trouble trying to convert a text file into a list of lists split by commas. Basically, I want:</p>
  
  <pre><code>DATE  OF OCCURRENCE,WARD,LONGITUDE,LATITUDE
  06/04/2011,3,-87.61619704286184,41.82254380664193
  06/04/2011,20,-87.62391924557963,41.79367531770095
  </code></pre>
  
  <p>to look like:</p>
  
  <pre><code>[["DATE  OF OCCURRENCE", "WARD", "LONGITUDE" , "LATITUDE"],
   ["06/04/2011", "3", "-87.61619704286184", "41.82254380664193"],
   ["06/04/2011", "20", "-87.62391924557963", "41.79367531770095"]]
  </code></pre>
  
  <p>Here is the code I have so far: </p>
  
  <pre><code>row = []
  crimefile = open(fileName, 'r')
  for line in crimefile.readlines():
      row.append([line])
      for i in line.split(","):
          row[-1].append(i)
  </code></pre>
  
  <p>However, this gets me a result of:</p>
  
  <pre class="lang-py prettyprint-override"><code>[['DATE  OF OCCURRENCE,WARD,LONGITUDE,LATITUDE\n', 'DATE  OF OCCURRENCE', 'WARD', 'LONGITUDE', 'LATITUDE\n'], 
  ['06/04/2011,3,-87.61619704286184,41.82254380664193\n', '06/04/2011', '3', '-87.61619704286184', '41.82254380664193\n'], 
  ['06/04/2011,20,-87.62391924557963,41.79367531770095', '06/04/2011', '20', '-87.62391924557963', '41.79367531770095']]
  </code></pre>
  
  <p>I just want to be able to remove that first part and replace it with the second. How can I do that?</p>