write python list of tuples to sqlite -


how write list of tuples sqlite db? e.g. mylist = [(1,2), (3,1), (1,4)]

import sqlite3 conn = sqlite3.connect('test.db') c = conn.cursor() c.execute("insert table_name values mylist") 

try this:

c.execute('insert  table_name(first_column_name, second_column_name) values(?, ?)',var) 

Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -