Python : How to insert a dictionary to a sqlite database?

后端 未结 5 1029
别那么骄傲
别那么骄傲 2020-12-09 05:43

I have a sqlite database with a table with following columns :

id(int) , name(text) , dob(text)

I want to insert following dictionary to it

5条回答
  •  再見小時候
    2020-12-09 06:20

    As per Gareth‘s response, if you're using MySQLdb you can use executemany and pass a list of values which you can get directly from your dict using dict.values()

提交回复
热议问题