472,334 Members | 2,333 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,334 software developers and data experts.

SQLite and Python 2.4

I'm confused. (Not a new experience). I've got a web application running
under Zope. I use the Wing IDE for testing and debugging. When trying to
recreate problems that come up on the web, I wrote some little routines that
pull my cookies out of the Firefox cookies.txt file into my code. That way,
I'm working with all the same options under Wing that my app uses when
running under Zope.

That's worked great until I upgraded to Firefox 3. Firefox 3 moved their
cookies from cookies.txt to cookies.sqlite. I haven't worked with SQLite at
all so I started searching for examples and found this;

import sqlite3
conn = sqlite3.connect('test.db')
c = conn.cursor()
rows = c.execute('SELECT * from somefile')

Looks simple enough but I can't get it to work. Here are my questions;

1. How do you get sqlite3 for Python 2.4? I can't find it anywhere.

2. If sqlite3 is only for Python 2.5, does sqlite2 work the same way?

3. Looking at the cookies.sqlite file, I see some text right at the top
"SQLite format 3". Does that mean that I need to use sqlite3?

I kind of got the above example using pysqlite2.4.1 for python 2.4. I get
through the part where I create the connection object but the resulting
object doesn't have a cursor method. I thought that maybe it wasn't
recognizing the cookies.sqlite file as a SQLite database so I tried the same
code giving it a junk text file instead and it behaved the same way. Since
I didn't get an error message, I'm thinking that I've got the wrong version
for the Firefox cookies.sqlite file.

I don't have a clue as to where else to look to trace it down. I'm hoping
that someone here is more familiar with it and can give me some pointers.

Thanks,

Joe Goldthwaite

Jul 2 '08 #1
2 3810
Hi Joe!

Am Tue, 01 Jul 2008 17:51:35 -0700 schrieb Joe Goldthwaite:
I'm confused. (Not a new experience).
Everyone looking for help in the usenet asking for help is sharing your
disease.
I've got a web application
running under Zope. I use the Wing IDE for testing and debugging.
Okay, you use the best development tool I've spotted so far...
When
trying to recreate problems that come up on the web, I wrote some little
routines that pull my cookies out of the Firefox cookies.txt file into
my code. That way, I'm working with all the same options under Wing that
my app uses when running under Zope.

That's worked great until I upgraded to Firefox 3. Firefox 3 moved their
cookies from cookies.txt to cookies.sqlite.
Which is quite handssome :-)
I haven't worked with
SQLite at all so I started searching for examples and found this;

import sqlite3 <<-- This works only if you're using Python >=2.5.x
1. How do you get sqlite3 for Python 2.4? I can't find it anywhere.
Never ever. Use http://www.pysqlite.org instead.
2. If sqlite3 is only for Python 2.5, does sqlite2 work the same way?
Think so. Never spotted problems.
3. Looking at the cookies.sqlite file, I see some text right at the top
"SQLite format 3". Does that mean that I need to use sqlite3?
No, not really.
But if I may make a suggestion, before you start spinning your brain off
with SQL syntax, analyze the database setup of firefox3 a bit and take a
look at SQLalchemy. I use it a lot and I bet you will like it - you just
have to care about your objects (in your case cookie checking) not about
the SQL at all.
I like it :-)

Regards,
Steffen
Jul 4 '08 #2
There is an "SQLite Manager" add-on for Firefox which is pretty neat.
Have a look at
https://addons.mozilla.org/en-US/fir...sqlite&cat=all. Might
be useful to you!

Tim

Steffen Mutter wrote:
Hi Joe!

Am Tue, 01 Jul 2008 17:51:35 -0700 schrieb Joe Goldthwaite:

>I'm confused. (Not a new experience).

Everyone looking for help in the usenet asking for help is sharing your
disease.

> I've got a web application
running under Zope. I use the Wing IDE for testing and debugging.

Okay, you use the best development tool I've spotted so far...

> When
trying to recreate problems that come up on the web, I wrote some little
routines that pull my cookies out of the Firefox cookies.txt file into
my code. That way, I'm working with all the same options under Wing that
my app uses when running under Zope.

That's worked great until I upgraded to Firefox 3. Firefox 3 moved their
cookies from cookies.txt to cookies.sqlite.

Which is quite handssome :-)

> I haven't worked with
SQLite at all so I started searching for examples and found this;

import sqlite3 <<-- This works only if you're using Python >=2.5.x

>1. How do you get sqlite3 for Python 2.4? I can't find it anywhere.

Never ever. Use http://www.pysqlite.org instead.

>2. If sqlite3 is only for Python 2.5, does sqlite2 work the same way?

Think so. Never spotted problems.

>3. Looking at the cookies.sqlite file, I see some text right at the top
"SQLite format 3". Does that mean that I need to use sqlite3?

No, not really.
But if I may make a suggestion, before you start spinning your brain off
with SQL syntax, analyze the database setup of firefox3 a bit and take a
look at SQLalchemy. I use it a lot and I bet you will like it - you just
have to care about your objects (in your case cookie checking) not about
the SQL at all.
I like it :-)

Regards,
Steffen
--
http://mail.python.org/mailman/listinfo/python-list

Jul 7 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: John Salerno | last post by:
I've been looking around and reading, and I have a few more questions about SQLite in particular, as it relates to Python. 1. What is the current...
14
by: 7stud | last post by:
Does sqlite come in a mac version? Thanks.
3
by: ricardo.turpino | last post by:
Hi, I've installed Mac Python 2.5. I'm running Mac OS X 10.4.10 on a Macbook 1.83GHz. I though that the python sqlite library was installed by...
1
by: mikhail.savitsky | last post by:
Hi, Official Python distro is very stable, with release cycle of around 1 year. However, to include the new version of SQLite, which has a much...
3
by: kyosohma | last post by:
Hi, I am trying to use sqlite to create a local database for an application I am writing and I am getting some screwy results from it....
3
by: Daniel Fetchinson | last post by:
Does Python 2.5.2's embedded SQLite support full text searching? Sqlite itself is not distributed with python. Only a python db api compliant...
0
by: Guilherme Polo | last post by:
On Tue, Jul 1, 2008 at 9:51 PM, Joe Goldthwaite <joe@goldthwaites.comwrote: You need sqlite itself (www.sqlite.org) and bindings, pysqlite 2...
0
by: Joe Goldthwaite | last post by:
Thanks Guilherme. That helped. I guess I was thinking that pysqlite would automatically come with some version of sqlite. The fact that it...
20
by: timotoole | last post by:
Hi all, On a (sun) webserver that I use, there is python 2.5.1 installed. I'd like to use sqlite3 with this, however sqlite3 is not installed on...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.