Python XLWT attempt to overwrite cell workaround

前端 未结 4 598
悲&欢浪女
悲&欢浪女 2020-12-09 05:01

Using the python module xlwt, writing to the same cell twice throws an error:

Message File Name   Line    Position    
Traceback               
    

        
4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-09 05:08

    The problem is that overwriting of worksheet data is disabled by default in xlwt. You have to allow it explicitly, like so:

    worksheet = workbook.add_sheet("Sheet 1", cell_overwrite_ok=True)
    

提交回复
热议问题