First page Back Continue Last page Overview Graphics

Starting with SQLITE

import sqlite3

connection = sqlite3.connect("accounts.db")

The connection to the data base will be created / opened with the connect() method.

The data base „accounts.db“ has to be in the same directory as the Python program file. It it doesn't exists, a new empty file will be automatically created.

If the data base is only needed for the duration of the program, we can create the data base in internal memory (RAM). In this case we don't use a filename, but this notation:

connection = sqlite3.connect(":memory:")