CS 257: Software Design

Lab: postgres and python using psycopg2

To access a PostgreSQL database from a Python program, we will use the psycopg2 module. This short exercise is intended to get you ready to use psycopg2 when you start developing your own database-driven application.

Things to do

Once you have the sample program working, reread the code to nail down in your brain this basic sequence of steps involved in querying your database from your code: