#!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2010 Doug Hellmann. All rights reserved. # """Query tasks in the database. """ #end_pymotw_header import sqlite3 db_filename = 'todo.db' with sqlite3.connect(db_filename) as conn: cursor = conn.cursor() cursor.execute(""" select * from task where project = 'pymotw' """) print 'Task table has these columns:' for colinfo in cursor.description: print colinfo