chinaunix网友2009-09-09 10:16
请问为什么都是xls,而另一个报codepage问题呢?多谢指点
>>> import xlrd
>>> book = xlrd.op
Traceback (most recent call last):
File "", line 1, in
book = xlrd.op
AttributeError: 'module' object has no attribute 'op'
>>> book = xlrd.open_workbook('E:\\hlr_scp\\GPRStslist.xls')
ERROR *** codepage 21010 -> encoding 'unknown_codepage_21010' -> LookupError: unknown encoding: unknown_codepage_21010
Traceback (most recent call last):
File "", line 1, in
book = xlrd.open_workbook('E:\\hlr_scp\\GPRStslist.xls')
File "E:\Python26\lib\site-packages\xlrd\__init__.py", line 386, in open_workbook
bk.parse_globals()
File "E:\Python26\lib\site-packages\xlrd\__init__.py", line 1264, in parse_globals
self.handle_codepage(data)
File "E:\Python26\lib\site-packages\xlrd\__init__.py", line 963, in handle_codepage
self.derive_encoding()
File "E:\Python26\lib\site-packages\xlrd\__init__.py", line 944, in derive_encoding
_unused = unicode('trial', self.encoding)
LookupError: unknown encoding: unknown_codepage_21010
>>> book = xlrd.open_workbook('E:\hlr_scp\GSM本地号段表(HLR&SCP)-20090716.xls')