#!/usr/local/bin/python2.7 '''Lists all the actors in the database This is written with less HTML, allowing that to be supplied by the Jinja2 templating engine Written Fall 2016 Scott D. Anderson ''' import sys import MySQLdb import dbconn2 from scottdsn import DSN # ================================================================ # The functions that do most of the work. def getList(conn): '''Returns a list of actor info (names and birthdates)''' curs = conn.cursor(MySQLdb.cursors.DictCursor) # results as Dictionaries curs.execute('select name,birthdate from person') return curs.fetchall() def getNames(conn): '''Returns a string of LI elements, listing all actors and birthdates''' rows = getList(conn) lines = [ u'