Sqlite and Python — return a dictionary using fetchone()?

后端 未结 8 1726
没有蜡笔的小新
没有蜡笔的小新 2021-01-31 04:03

I\'m using sqlite3 in python 2.5. I\'ve created a table that looks like this:

   create table votes (
      bill text,
      senator_id text,
      vote text)
<         


        
8条回答
  •  故里飘歌
    2021-01-31 04:13

    Sure, make yourself a DictConnection and DictCursor as explained and shown at http://trac.edgewall.org/pysqlite.org-mirror/wiki/PysqliteFactories for example.

提交回复
热议问题