#!/usr/bin/env python
# -*- coding: iso8859-1 -*-

# Module name: python-mysqldb

import MySQLdb

cnx = MySQLdb.connect(db='pysqldb', user='root')
cursor = cnx.cursor()

cursor.execute("select first_name, last_name from person")

while True:
    fetched = cursor.fetchall()
    if not fetched:
        break

    for f_name, l_name in fetched:
        print "%s %s" % (f_name, l_name)
    
#    Every table is a class
#    Every row is an instance
#    Columns become attributes

