I've been trying (unsuccessfully) to import an existing SQLite database into Python. I want to write a script in Python to run a large set of database queries all at once.
When I try to connect to the SQLite file, Python writes a new file with the same name in folder I'm trying to connect to. Code as follows:
import sqlite3;
conn = sqlite3.connect("C:\Test\Databasename.sqlite")
c = conn.cursor()
When I then try to run queries on specific tables, Python displays 'cannot find table (or similar)' because it has created a new database file; as opposed to importing the existing one.
How do I get Python to open my existing file? I've had a lengthy scour on here, I haven't been able to find an answer sadly :()
Many thanks for any assistance.