import sqlite3 as sql
import os
db_folder = "D:/Python/databases/accounts.sqlite"
db = sql.connect(db_folder)
im = sql.Cursor()
im.execute("""CREATE TABLE IF NOT EXISTS 'accounts' (
id TEXT DEFAULT 'account' UNIQUE
pw TEXT DEFAULT 'password
email TEXT UNIQUE
)
""")
datas = [
("eren.arc1","1236"),
("ern.arc"),
(none,none,"[email protected]")
]
if not os.path.exists(db_folder):
for data in datas :
im.execute("""INSERT INTO 'accounts' VALUES (?,?,?)""",datas)
db.commit()
I ran this code and I got this error:
File "databases/db4.py", line 6, in <module>
im = sql.Cursor()
TypeError: function takes exactly 1 argument (0 given)
What is the problem? I did not see argument frequently in cursor function.
Note: I used cursor() but then I took sqlite3 hasn't got cursor attribute error. Then I changed it to Cursor().
cursor()without capital C ?