cur = connection.cursor() cur.execute("select * from MyTable") for column in cur.description: print(column)