问题描述
|
在我的应用程序中,我上传了一个excel文件并尝试读取数据。
我正在尝试按照以下方式,
@expose()
def save(self,**params):
xls_file = params[\'xls_file\']
wb = xlrd.open_workbook(bill_file,\'w\')
sh = wb.sheet_by_index(0)
for i,rownum in enumerate(range(sh.nrows)):
print sh.row_values(rownum)
但是出现以下错误:
TypeError:强制转换为Unicode:需要字符串或缓冲区,找到实例
open_workbook视图中的模块xlrd:425
<< encoding_override = encoding_override,
formatting_info = formatting_info,
on_demand = on_demand,
)
t1 = time.clock()
on_demand = on_demand,
biff2_8_load视图中的模块xlrd:878
<<重试= False
尝试:
f =打开(文件名,open_mode)
除了IOError:
e,v = sys.exc_info()[:2]
f =打开(文件名,open_mode)
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)