Python Inquiries (11)

7 Name: Tokpoku : 2006-10-16 00:46 ID:+yRoP9Cl

SQLite is the way! In fact since python2.5 it is integrated with python, if you use 2.4 or less just download the sqlite3 module and the sqlite client (all plataforms), this is a quick example.

#open or create the database if it doesn't exist.
import sqlite3
conn = sqlite3.Connection('path/to/database.anyextension')
#let's assume the tables are there ok?
cur = conn.cursor()
pattern = "%lonely heart%" #any tring will do
res = cur.execute("select file from repo where title like " + pattern)
print res
# I didn't run the above code, might not run as is

This thread has been closed. You cannot post in this thread any longer.