我在 python 中使用 mysql.connector 从数据库中获取值列表。
你能帮忙分别从列表中提取每个值吗
我的代码如下
cnx = mysql.connector.connect(host=mysql_localhost, user=user, password=password, database=database)
cursor = cnx.cursor()
cursor.execute("select * from settings" )
results = cursor.fetchall()
print(results)
我得到的结果是如下列表
[(0, 3232235535L, 0, 12, 12.1, 22.5, 29.0)]
然后我想做的是从上面的列表中分别获取每个值(整数或浮点数)