sqlite 3 : sqlite « Database « Python Tutorial






import sqlite3
cxn = sqlite3.connect('sqlite_test/test')
cur = cxn.cursor()
cur.execute('CREATE TABLE users(login VARCHAR(8), uid INTEGER)')
cur.execute('INSERT INTO users VALUES("john", 100)')
cur.execute('INSERT INTO users VALUES("jane", 110)')
cur.execute('SELECT * FROM users')
for eachUser in cur.fetchall():
     print eachUser
cur.execute('DROP TABLE users')
cur.close()
cxn.commit()
cxn.close()








15.6.sqlite
15.6.1.sqlite 3