import MySQLdb def update(): c = cursor() c.execute("SELECT * FROM stockList") return [x.values()[1] for x in c.fetchall()] def cursor(): return MySQLdb.connect("mysql.tjhsst.edu","jsherwoo","petra9","jsherwoo").cursor(MySQLdb.cursors.DictCursor)