My python 3.6 code is supposed to create a database and create a table inside it.
import sqlite3
db_filename = 'database.db'
connect = sqlite3.connect(db_filename)
c = connect.cursor()
c.execute('CREATE TABLE IF NOT EXISTS task (id number PRIMARY KEY, priority integer, details text, status text)')
connect.commit()
connect.close()
However the output is not what I intended. I am getting weird characters included in the .db file;
SQLite format 3 @ .�
� b b� k�9tabletasktaskCREATE TABLE task (id number PRIMARY KEY, priority integer, details text, status text)'; indexsqlite_autoindex_task_1task
If anyone could tell me where I went wrong I would be grateful.
Thanks.