Python
  Home arrow Python arrow Using SQLite in Python
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PYTHON

Using SQLite in Python
By: Peyton McCullough
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 90
    2006-04-12


    Table of Contents:
  • Using SQLite in Python
  • Connecting to a Database
  • Writing Data
  • Retrieving Data
  • Adapting and Converting

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    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.



     
     
    >>> More Python Articles          >>> More By Peyton McCullough
     

       

    PYTHON ARTICLES

    - Tuples and Other Python Object Types
    - The Dictionary Python Object Type
    - String and List Python Object Types
    - Introducing Python Object Types
    - Mobile Programming using PyS60: Advanced UI ...
    - Nested Functions in Python
    - Python Parameters, Functions and Arguments
    - Python Statements and Functions
    - Statements and Iterators in Python
    - Sequences and Sets in Python
    - Python Expressions and Operators
    - Dictionaries, Variables and Statements in Py...
    - Data Types in Python
    - The Python Language
    - SSH with Twisted





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
    Stay green...Green IT