原文链接:http://www.juzicode.com/python-error-exception-unexpected-data-type-class-bytes
错误提示:
#juzicode.com/VX公众号:juzicode
import xlwt
wb = xlwt.Workbook()
ws = wb.add_sheet('juzicode')
a = b'juzicode'
ws.write(3, 0, '桔子code')
ws.write(3, 1, a) #bytes
==========运行结果:
---------------------------------------------------------------------------
Exception Traceback (most recent call last)
Cell In[9], line 7
5 a = b'juzicode'
6 ws.write(3, 0, '桔子code') #str
----> 7 ws.write(3, 1, a) #bytes
File D:\Python\Python310\lib\site-packages\xlwt\Worksheet.py:1088, in Worksheet.write(self, r, c, label, style)
1035 def write(self, r, c, label="", style=Style.default_style):
1036

最低0.47元/天 解锁文章
819

被折叠的 条评论
为什么被折叠?



