sqlite and TemporaryFile under Windows

Paul McNett p at ulmcnett.com
Mon Oct 15 16:58:35 EDT 2007


Matthieu Brucher wrote:
> I want to create a temporary database that is downloaded for the net. So 
> I want to use a temporary file that will be deleted at the end of my 
> program. For this, I wanted to use tempfile.TemporaryFile. The problem 
> with Windows is that I can't give to sqlite3.connect() the file neither 
> can I give its name (if I use NamedTemporaryFile). Is there a solution 
> somewhere ?

Are you aware that you can do an in-memory database (IOW no file at all)?

cur = sqlite.connect(":memory:")


-- 
pkm ~ http://paulmcnett.com



More information about the Python-list mailing list