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
Post a Comment