0
我一直在收到这个错误,并试图了解我做错了几个小时。我过去曾多次使用此模板成功导入sqlite3。Python sqlite3值错误
def TestImport():
con = sqlite3.connect("test.db")
con.execute("CREATE TABLE IF NOT EXISTS TestTable(ColA,ColB)")
data=[('x','y')]
stmt = "INSERT INTO TestTable VALUES(?,?)"
con.execute(data,stmt)
con.commit()
con.close()
然而,这一次,我收到此错误:
ValueError: operation parameter must be str or unicode
这里
con.execute(data,stmt)