import pymysql.cursors

connection = pymysql.connect(host='172.16.250.156',
                             user='xedk',
                             password='admin',
                             db='xedk',
                             charset='utf8mb4',
                             port=3308,
                             cursorclass=pymysql.cursors.DictCursor)
cursor=connection.cursor()
cursor.execute("select * from AC_LN_LO where LOAN_NO = 'cz201405261115079828'")
result = cursor.fetchall()#fechone()

for a in result:
    print a
print len(result)