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内容如下:

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM