Using SQLite in Python (
Page 1 of 5 )
SQLite is a small C library that implements a self-contained SQL database engine. This article examines pysqlite, one of a number of libraries in Python, that is used as an interface with SQLite.SQLite is a small database engine that's gained quite a bit of popularity, and this popularity does appear to be deserved. SQLite stands alone and doesn't require any special dependencies. All the database interaction is done through whatever program needs to access the information, and the database itself is stored in a single file. Because of this, there is no confusing configuration involved, and SQLite is small and, in many applications, quite fast. It's also been released in the public domain.
Its presence in several languages is no secret, but what many people don't know is that there are also a few Python SQLite libraries. One of these libraries is pysqlite, which allows for painless database interaction. In this article, we'll explore SQLite and pysqlite and their capabilities. While prior database experience in Python is not required, you should be familiar with SQL in general.
Obtaining the Library
The pysqlite library may be obtained at its website:
http://initd.org/tracker/pysqlite
Windows users can simply download and run the pysqlite binary to install the product. Users of Linux and other similar operating systems will need to download the source distribution, and they will need SQLite and the SQLite development files installed. Many distributions already come with the library, so check for it. If not, you may obtain SQLite from its website:
http://sqlite.org/
The library is installed just like most other Python libraries. First, you must build the library:
python setup.py build
Next, simply install what you've just built. Make sure you have the proper privileges to do this:
python setup.py install
If everything went as it should, then pysqlite is now installed and ready for use.
| | Discuss Using SQLite in Python | | | | | | | Hello, all,
There are a number of ways to store data in Python, and I believe... | | | | | | The commit() method is a member of the connection class and not the cursor... | | | | | | Hello at first,
I\'ve found this article late, but not to late. Thank You. I\'m... | | | | | | Nice tutorial Peyton. Lately I've found myself wrestling with a bunch of poorly... | | | | | | This tutorial-articles is definitely the best for beginners like me. :) Easy to... | | | | | | Hmm, I see you posted this article in 2006, and here in 2008, I find it.
After... | | | | | | hello, your article is great and it shall help me a lot in my program but i am... | | | | | | Hello, I have gone through the whole explanation pasting dutifully
consecutive... | | | | | | hi i think at the top of the exam code should be:
row = cursor.fetchone()
for row... | | | | | | For a python module which warehouses any arbitrary object, including dictionaries,... | | | | | | >>> Post your comment now! | | | | | |
|