473,657 Members | 2,851 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: SQLite and Python 2.4

On Tue, Jul 1, 2008 at 9:51 PM, Joe Goldthwaite <jo*@goldthwait es.comwrote:
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('SELE CT * 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.
You need sqlite itself (www.sqlite.org) and bindings, pysqlite 2
(http://oss.itsystementwicklung.de/trac/pysqlite/) or aspw
(http://code.google.com/p/apsw/)
>
2. If sqlite3 is only for Python 2.5, does sqlite2 work the same way?
You are confused, yes. The sqlite3 package that comes with python2.5
is actually pysqlite2, which interfaces with sqlite3.
Also, sqlite3 and sqlite2 files format are not compatible.
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?
Yes
>
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

--
http://mail.python.org/mailman/listinfo/python-list


--
-- Guilherme H. Polo Goncalves
Jul 2 '08 #1
0 1393

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

Similar topics

12
2478
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 out until Python 2.5? 2. What's the difference between sqlite and pysqlite? Do you need both, just one, or is one an older version of the same thing? 3. What's the difference between the command line program called sqlite3
14
2970
by: 7stud | last post by:
Does sqlite come in a mac version? Thanks.
3
3596
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 still have a problem. Sqlite does not appear to be my system: Traceback (most recent call last):
1
1538
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 Python distribution (to compile with the new SQLite headers) - this is from Python docs. Therefore, inclusion of PySQLite in Python-2.5.1 distro effectively shrinks the Python release cycle to that of SQLite. I would not have minded, except that...
3
1578
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 trying to select a date range and sum those values. My problem is that it only sums up every other date range and ignores the in between ranges.
3
275
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 is completely independent of the sqlite build. In other words, if your sqlite build supports full text searching you can use it through the python sqlite wrapper (that is part of the stdlib) and if it doesn't then not. This is true for any sqlite...
2
3928
by: Joe Goldthwaite | last post by:
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...
0
2568
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 results. I downloaded the Windows version of the SQLite3.dll. I didn't know where to put it so I first put it in its own directory and tried to register it. That didn't work so I just moved it to the pysqlite directory in site-packages. That did...
20
3964
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 using a sun machine (I normally use linux machines) and place this in my lunix home account would I be able to use python and sqlite? Any thoughts? I know its a bit of a stretch ...
0
8385
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8303
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
7316
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1601
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.