view Doc/includes/sqlite3/execute_3.py @ 51334:8aa71c19dcb8 legacy-trunk

#5059: fix example.
author Georg Brandl <georg@python.org>
date Thu, 05 Feb 2009 10:59:28 +0000
parents c62f6669ae22
children
line wrap: on
line source

import sqlite3

con = sqlite3.connect("mydb")

cur = con.cursor()

who = "Yeltsin"
age = 72

cur.execute("select name_last, age from people where name_last=:who and age=:age",
    locals())
print cur.fetchone()