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

Philip Semanchuk philip at semanchuk.com
Tue Oct 6 21:36:11 EDT 2009


On Oct 6, 2009, at 7:28 PM, tcumming123 at gmail.com wrote:

> 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).

As someone else suggested, you could send a single .py file that  
creates a default database if it doesn't find one in the current  
directory (or ~/.your_app or a directory of your choosing). Does that  
give you most of what you want?



Cheers
Philip


> On Tue, Oct 6, 2009 at 11:31 AM, Robert Kern <robert.kern at gmail.com>  
> wrote:
>
>> On 2009-10-06 16:16 PM, tcumming123 at 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




More information about the Python-list mailing list