xxi python db-api accessing database from python the db-api the connect function the connection object the cursor object mappings from database types to python types generating errors row descriptions transactions in pymysql online resources pymysql module the pymysql module working with the pymysql module importing the module connect to the database obtaining the cursor object using the cursor object obtaining information about the results fetching results close the connection complete pymysql query example inserting data to the database updating data in the database deleting data in the database creating tables online resources exercises part vi logging introduction to logging introduction why log what is the purpose of logging what should you log what not to log why not just use print online resources logging in python the logging module the logger