Python,
pasted
on Dec 6:
|
import sqlite3
db = sqlite3.connect("data.sqlite")
cursor = db.cursor()
cursor.execute("CREATE TABLE table IF NOT EXISTS(author INT, channel INT)")
cursor.execute("INSERT INTO table (author, channel) VALUES(0, 1)")
cursor.execute("INSERT INTO table (author, channel) VALUES(1, 2)")
print(cursor.execute("SELECT * FROM table").fetchall())
|
Output:
|
Traceback (most recent call last):
Line 1, in <module>
import sqlite3
File "/usr/lib/python2.5/sqlite3/__init__.py", line 24, in <module>
from dbapi2 import *
File "/usr/lib/python2.5/sqlite3/dbapi2.py", line 27, in <module>
from _sqlite3 import *
ImportError: No module named _sqlite3
|
|