Get the column name use inquiry result:
import sqlite3
db=sqlite3.connect('data.db')
cur=db.cursor()
cur.execute('SELECT * FROM table')
col_name_list=[i[0] for i in cur.description]
print col_name_list
Get all column names:
cur.execute('PRAGMA table_info(table)')
print cur.fetchall()