[ create a new paste ] login | about

Link: http://codepad.org/e2i8X5Rc    [ raw code | output | fork ]

Python, pasted on Dec 6:
1
2
3
4
5
6
7
8
9
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:
1
2
3
4
5
6
7
8
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


Create a new paste based on this one


Comments: