Created
October 23, 2012 11:30
-
-
Save st4lk/3938290 to your computer and use it in GitHub Desktop.
Python: Save excel workbook copy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from xlrd import open_workbook | |
from xlutils.copy import copy | |
def save_workbook_copy(file_from, file_to): | |
rb = open_workbook(file_from, formatting_info=True) | |
wb = copy(rb) # a writable copy (I can't read values out of this, only write to it) | |
w_sheet = wb.get_sheet(0) # the sheet to write to within the writable copy | |
row_index = 0 | |
col_index = 0 | |
w_sheet.write(row_index, col_index,'DataToBeWritten') | |
wb.save(file_to) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment