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

2009-10-06 Thread tcumming123
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.

If there is a way to do this, I could (for example) have an address book
app, _AND_ the address book all in the same file. I could put the file on a
usb stick and move it to any other computer. Then click on the file and get
my address book, all without installing anything (even temporary files) on
the local computer. I could add new entries into my address book, copy the
"app+db" file to yet another computer... Note that this would _not_ extract
and/or install files into the local computer. Everything would always stay
within the one "app+db" file.

I suspect that one way to do it would be to have a generic boot-up script
that does some magic that will convince sqlite that the database is some
offset into the file. That way the first part of the file would remain
untouched by sqlite so the file could start with the usual, "#!/usr/bin/env
python" stuff. The actual app could be placed in a well known entry in the
db.

Of course the, "app" could not use any loadable modules that are not,
"common" (and/or keep loadable modules in the db somehow) allowing it to be
moved to most machines. BTW., "most machines" doesn't have to include Windoz
machines...

Any ideas?

tom
-- 
http://mail.python.org/mailman/listinfo/python-list


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

2009-10-06 Thread tcumming123
Ya, I thought of that... However...

   - It would be nice to be able to execute it directly (i.e,. click on it).
   You can't, "execute" a directory.
   - It would be more work to send as an email attachment.
   - I thought it was a cool idea, and had hoped someone else had figured
   out how to do it.

In my case, I have a bunch of data to plot, and I'd like to be able to send
both the data and a program to view and manipulate the data. When the
recipient is done, they have the option of deleting the one file and there's
no mess. It got me thinking of lots of other things the general paradigm
would work for (i.e., my address book example).

tom

On Tue, Oct 6, 2009 at 11:31 AM, Robert Kern  wrote:

> On 2009-10-06 16:16 PM, tcumming...@gmail.com 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.
>>
>
> Would having the app and the data file in the same directory satisfy your
> use case just as well? You could move the directory around just as well as
> you could move the file.
>
> --
> Robert Kern
>
> "I have come to believe that the whole world is an enigma, a harmless
> enigma
>  that is made terrible by our own mad attempt to interpret it as though it
> had
>  an underlying truth."
>  -- Umberto Eco
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list