view Doc/includes/sqlite3/rowclass.py @ 69908:9688977ef567

test_ftplib.py: change client default timeout from 10 to 2. Hanging for 10 seconds is way too much when we expect a server response which never comes in.
author Giampaolo Rodola' <g.rodola@gmail.com>
date Sat, 07 May 2011 17:08:34 +0200
parents 9e1529bf0442
children 9eb77d455be1
line wrap: on
line source

import sqlite3

con = sqlite3.connect("mydb")
con.row_factory = sqlite3.Row

cur = con.cursor()
cur.execute("select name_last, age from people")
for row in cur:
    assert row[0] == row["name_last"]
    assert row["name_last"] == row["nAmE_lAsT"]
    assert row[1] == row["age"]
    assert row[1] == row["AgE"]