#!/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內容以下:python