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.