我使用mysql.connector库按照下面的代码过滤蟒蛇的MySQL结果
cnx = mysql.connector.connect(host=mysql_localhost, user=user, password=password, database=database)
cursor = cnx.cursor()
cursor.execute("select * from settings")
results = cursor.fetchall()
ID, server, port, user, password, temp_min ,temp_max = results[0]
print(user)
cursor.close()
cnx.close()
结果如下
u'admin'
运行从Python中的MySQL查询我注意到,在存储的值数据库作为varchar显示与u'' 我怎样才能得到没有u'的值所以所需的输出是
admin