[Solved] Python: sqlite3 [closed]


This is what the first parameter of the connect function is for:

import sqlite3

db = sqlite3.connect("C:/temp/MyLittleDatabase")
db.execute("CREATE TABLE IF NOT EXISTS T(x)")
db.execute("INSERT INTO T VALUES (42)")
cursor = db.execute("SELECT x FROM T")
for row in cursor:
    print row[0]

4

solved Python: sqlite3 [closed]