I am trying to create a program with sqlite3 database using Ubuntu (Xubuntu 14.04) and a pre-installed version of Python. I tried if the first lines work, but there is already an error. I installed "python-sqlite" and "sqlite3". Can anyone help?
import sqlite3 connection = sqlite3.connect('test.db') cursor = connection.cursor() cursor.execute('CREATE TABLE test ( id INTEGER, first INTEGER, second TEXT, third TEXT, other INTEGER)') connection.commit()
Conclusion:
user@device :~/folder$ python sqlite3.py Traceback (most recent call last): File "sqlite3.py", line 1, in <module> import sqlite3 File "/home/michael/ownCloud/sqlite3.py", line 3, in <module> connection = sqlite3.connect('test.db') AttributeError: 'module' object has no attribute 'connect'
Thanks in advance!
source share