数据库输出格式为dict

def __init__(self):
self.conn = pymysql.connect(
        host='xxxxx',
port=3806,
user='root',
        passwd=str(123456),
db = 'test',
charset = "utf8",
cursorclass=pymysql.cursors.DictCursor

)

结果:{'id': 1, 'name': '11'}

def __init__(self):
self.conn = pymysql.connect(
host='xxxxx',
port=3806,
user='root',
passwd=str(123456),
db = 'test',
charset = "utf8"

)
结果:(1, '11')
posted @ 2020-04-23 17:52  cc鱼  阅读(260)  评论(0编辑  收藏  举报