python解决list unicode转中文显示

#!/usr/bin/python#
#-*-coding:UTF-8-*-
import xlrd

book = xlrd.open_workbook('Interface_data.xlsx')
sheet = book.sheet_by_index(0)
rows = sheet.nrows
case_list = []
for i in range(rows):
    case_list.append(sheet.row_values(i))

#处理list中文乱码
case_list_righ = str(case_list).replace('u\'','\'')
print case_list_righ.decode("unicode-escape")

Excel内容如下:

 

posted @ 2017-02-28 15:46  悠然现南山  阅读(13258)  评论(1编辑  收藏  举报