does xlwt support xlsx Format

2019-01-23 13:52发布

I have searched into google and found some contradiction. Does xlwt support xlsx file (MS office 2007). I heard that xlwt 0.7.4 support xlsx file. Does anyone tried xlsx file writing operation with xlwt 0.7.4

The purpose of this question is,I do not have permission to install library if I need to install I need to provide more detail info. I need to write xlsx file in python.So if anyone has done similar thing it will help to provide better inforamtion

I have looked into this wiki page. https://pypi.python.org/pypi/xlwt But did not find that it support xlsx file

or Should I use https://pypi.python.org/pypi/openpyxl for writing xlsx File

标签: python xlwt
2条回答
Juvenile、少年°
2楼-- · 2019-01-23 14:20

The xlwt module doesn't support the xlsx format. The xlsx file format is completely different from the xls format supported by xlwt.

As an alternative have a look at XlsxWriter which is a Python module for creating xlsx files.

It supports a lot of Excel features. Have a look at the documentation or start with the examples.

查看更多
走好不送
3楼-- · 2019-01-23 14:23

openpyxl is guaranteed to write xlsx files. From a cursory read through some of the xlwt code and docs/examples, I don't think xlwt supports xlsx. If openpyxl does what you need it to do, why look elsewhere?

Edit: with xlwt version 0.7.4 I attempted to save a file as sample.xlsx. Upon attempting to open it I got a not valid error message, so no .xlsx files for now.

查看更多
登录 后发表回答