Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用 Python XLWT 将列表写入单元格。这可能吗?
我目前收到一个错误:
Exception: Unexpected data type <type 'list'>
编码:
for x in result: sheet1.write(row2,0,x[0]) sheet1.write(row2,1,x[1])
x[1] 将是一个列表。
谢谢!
尝试先将其转换为字符串:
for x in result: sheet1.write(row2,0,str(x[0])) sheet1.write(row2,1,str(x[1]))