#!/usr/bin/python # -*- coding: utf8 -*- import MySQLdb conn=MySQLdb.connect(host="localhost",user="root",passwd="phpcool",db="device") cursor=conn.cursor() cursor.execute("SET NAMES utf8") cursor.execute("select * from attribute") cds = cursor.fetchall() for row in cds: for r in row: p ...