Problem with sqlite

Duncan Booth duncan.booth at invalid.invalid
Sat Mar 29 14:19:36 EDT 2008


aiwarrior <zubeido at yahoo.com.br> wrote:

> When i execute this the database doesn't get filled with anything and
> the program stays running in memory for ever.

That's odd, when I execute the code you posted I just get "NameError: 
global name 'sqlite3' is not defined". You should always try to post the 
complete actual code you are using, not just some random part of it.

> The print statement is just a Unicode string that would get to the
> database if i stated it in the add_entry function as a constant
> string. It's a really weird problem that i dont seem to understand why
> it's working out this way.
> 
Are you absolutely certain of that? If you use print to try to debug the 
value of an object you should usually use repr:


                    print repr(audio['album'])

What MP3 library are you using?

You have forced a commit after every insert. This slows down sqlite A LOT. 
I get about 400 insertions each minute with your code (just inserting fixed 
strings) but if I remove the conn.isolation_level assignment and add a 
single commit at the end I get in excessive of 20000 per second. Are you 
sure you just didn't wait long enough?
 



More information about the Python-list mailing list