Combining python and sqlite DB into a single, "executeable".

Che M cmpython at
Wed Oct 7 00:24:46 CEST 2009

On Oct 6, 5:31 pm, Robert Kern <robert.k... at> wrote:
> On 2009-10-06 16:16 PM, tcumming... at wrote:
> > Any body got any ideas how to do the following...
> > I would like to be able to write an app in python that keeps it's
> > persistent data in a sqlite database file.
> > So far so good. The problem, is that I need the python app and the
> > sqlite db file to exist in the same disk file. This way the app to
> > access the data and the data are in the same file.

An SQLite database is a single file.  But it can't be "in
the same file" as the .py file (I don't think).

What's your goal?  If you just want to distribute a single file
to your users, you can make an executable Python file and have
it create a fresh (empty) SQLite database once it runs for the
first time.

More information about the Python-list mailing list