473,396 Members | 1,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 3912
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 module to use for sqlite? sqlite3? or is that not...
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 default as part of Mac Python 2.5, however, I...
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 shorter release cycle, one has to rebuild the main...
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. Basically, I have a set of values in the database and I am...
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 wrapper is part of the python stdlib and as such it...
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 (http://oss.itsystementwicklung.de/trac/pysqlite/) or...
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 doesn't is what was causing me to get the strange...
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 the webserver. If I were able to compile sqlite...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.