does xlwt support xlsx Format

拜拜、爱过 提交于 2019-11-29 01:21:22

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.

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.

2019 update: xlwt doesn't support xlsx Format.

XlsxWriter is 100% compatible with xlsx, well-maintained and has a good reputation.

For reading xlsx files, you can use xlrd.

You can also use Pandas if you've read+write requirements and want to create graphs and charts. (Pandas internally uses XlsxWriter modules to write the files).

P.S. - The last x in xlsx stands for XML. xlsx is a zipped Open XML file. Use xlsx wherever possible. xls is the old (proprietary) format, which doesn't have some advanced features like conditional formatting or freezing col/rows etc.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!