title: How can I reference columns by their names in python calling SQLite?
body: <p>I have some code which I've been using to query MySQL, and I'm hoping to use it with SQLite. My real hope is that this will not involve making too many changes to the code. Unfortunately, the following code doesn't work with SQLite:</p>
  
  <pre><code>cursor.execute(query)
  
  rows = cursor.fetchall()
  
  data = []
  for row in rows
    data.append(row["column_name"])
  </code></pre>
  
  <p>This gives the following error:</p>
  
  <pre><code> TypeError: tuple indices must be integers
  </code></pre>
  
  <p>Whereas if I change the reference to use a column number, it works fine:</p>
  
  <pre><code>  data.append(row[1])
  </code></pre>
  
  <p>Can I execute the query in such a way that I can reference columns by their names?</p>