I have created Excel Sheet using the XLWT plugin using Python. Now, I have to open the Excel sheet again and add new sheets / columns to the existing sheet. Is it possible to do Python?
Today after the investigation, (2014-2-18) I xlwt Can not see any way to read in XLS file. You can only write from fresh I think it is better to use openpyxl
. Here's a simple example: openpyxl import workbook, load_workbook wb = workbook () ws = wb.create_sheet () ws.title = 'Pi' ws.cell ('F5') to
. Value = 3.14156265 wb.save (filename = r'C: \ book2.xls') # Re-open file: wb_re_read = load_workbook (filename = r'C: \ book2.xls') sheet = wb_re_read.get_sheet_by_name ('Pi
See other examples here (where this revised example has been taken)
Comments
Post a Comment