#!/usr/bin/python import MySQLdb try: conn=MySQLdb.connect(host='localhost',user='root',passwd='yourpasswd',db='yourdb') cur=conn.cursor() cur.execute('desc bus_gps') rows=cur.fetchall() desc = cur.description name_type_dict={} for row in rows: name_…