How to define a db file for sqlite?
cosmo_general at yahoo.com
Sun Mar 8 08:32:45 CET 2009
I just downloaded and installed pysqlite, and I can import sqlite3
smoothly. Then, I need to connect sqlite by syntax:
>>>conn = sqlite3.connect('adirectory/db')
I wish the data will be stored into directory ---> adirectory, with a
file named in db. But I got kicked out with an error message as:
Unable to open database file
I wonder: does pysqlite open a database file db for me? Or, do I need
to create an empty file inside adirectory with my text editor? Anyway,
somebody please help me out here. After I can connect it, the rest
will be easy to go, thanks!
More information about the Python-list