Write excel with python xlwt, pythonxlwt

Source: Internet
Author: User

Write excel with python xlwt, pythonxlwt
Write excel with python xlwt1. install

Pip install xlwt

2. xlwt. Workbook Object

There are two common methods: save and add_sheet.
1. save
2. add_sheet

3. Worksheets Object

Is created by the Workbook object. You can directly write data to the cell. You can also return the Rows class and write the cell by Rows.

4. Three cell writing methods: 5. Example of using the write method directly

Write a 99 multiplication table:

Import xlwtwb = xlwt. workbook () ws = wb. add_sheet ('sheet1') ws2 = wb. add_sheet ('sheet2') def write99 (): for I in range (1, 10): for j in range (1, 10): ws. write (I-1, J-1, I * jw.write99(%wb.save('aca.xls ')
References

Http://xlwt.readthedocs.org/en/latest/

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.