python 数据库查询返回list或tuple

MySQLdb默认查询结果都是返回tuple,输出时候不是很方便,必须按照0,1这样读取,无心中在网上找到简单的修改方法,就是传递一个cursors.DictCursor就行。python 默认程序:mysql import MySQLdb db = MySQLdb.connect(host='localhost', user='root', passwd='123456', db='test'
相关文章
相关标签/搜索