我想阅读excel文件并提取一些有关某些人的信息。你知道吗
这就是我要做的
import xlrd
dir = './schfiles';
files = os.listdir(dir);
f = files[0];
book = xlrd.open_workbook(dir+"/"+files[0]);
sh = book.sheet_by_index(0)
t = sh.cell_value(rowx=xlr2i(35),colx=xlc2i('F'))
t.find(u"Усманов")
var t中写入的字符串是u'\u0434\u043e\u0446。\u0423\u0441\u043c\u0430\u043d\u043e\u0432\u0411.\u0428.'看起来像“Доц”。УСМааааоВБ.Ш。”
u“УСМааааааоВ”表示为u'\xd3\xf1\xec\xe0\xee\xe2'
我尝试将这两个字符串编码为“utf8”,使用外部libs对它们进行解码,但没有任何帮助。你知道吗
有人知道怎么可能在这里找到一个子串吗?你知道吗
使用
# -*- coding: utf-8 -*-
作为脚本的第一行,告诉intepreter您使用的是哪种编码。你知道吗相关问题 更多 >
编程相关推荐