python中希腊字母的Unicode代码

python中希腊字母的Unicode代码,python,mysql,Python,Mysql,我在Python2.7版本中运行这段代码 import sys, os sys.path.append(os.path.join(os.path.split(os.path.abspath(__file__))[0], 'lib')) from bottle import route, run, static_file, request import pymysql as db import settings con = db.connect( settings.mysql_host,

我在Python2.7版本中运行这段代码

import sys, os
sys.path.append(os.path.join(os.path.split(os.path.abspath(__file__))[0], 'lib'))
from bottle import route, run, static_file, request
import pymysql as db
import settings

con = db.connect(
    settings.mysql_host, 
    settings.mysql_user, 
    settings.mysql_passwd, 
    settings.mysql_schema,
    charset='utf8',
    use_unicode=True)

cur = con.cursor()

cur.execute("SELECT tragoudi.titlos, tragoudi.etos_par, cd_production.etaireia FROM tragoudi JOIN singer_prod ON tragoudi.titlos=singer_prod.title JOIN cd_production ON singer_prod.cd=cd_production.code_cd GROUP BY tragoudi.titlos HAVING tragoudi.titlos LIKE %s AND tragoudi.etos_par LIKE %s AND cd_production.etaireia LIKE %s",("ΑΓΩΝΙΑ","1978","SONY"))
con.commit()

#cur.execute("SELECT * FROM kalitexnis")


for row in cur.fetchall():
    table = row[:]

print table
con.close()
因此,它给了我这样一个结果:

(u'\u0391\u0393\u03a9\u039d\u0399\u0391', 1978, u'SONY')
这是正确的,因为单词“ΑΓΓΝΑ΄”的unicode是
A=\u0391
Γ=\u0393
等。 所以我的问题是,当我打印表格时,是否有办法得到结果

(u'ΑΓΩΝΙΑ', 1978, u'SONY')

Python2使用u作为前缀,告诉它它是一个Unicode字符串,因此如果您逐个元素打印列表元素,它应该正确打印出来

因此:


如果您
打印表[0]
,它将正确显示字符,同时删除引号和
u
。元组显示其元素的
repr
。你真的需要你所展示的东西吗?读一下这个也许会对你有所帮助
for x in table
    print x