-1
我使用蟒2.7 我試圖這樣重寫excel文件的細胞而不影響其他片
from xlrd import *
from xlwt import *
file1 = r"abc.xls"
wbfile1 = open_workbook(file1)
file2 = r"xyz.xls"
wbfile2 = Workbook()
SheetName_file2 = wbfile2.add_sheet('sheet1',cell_overwrite_ok=True)
SheetName_file2.write(10,10,"Overwrite cell")
wbfile2.save(file2)
如果我運行着sheet1的這一點,細胞(10,10)被改變爲Overwrite cell
和剩餘的單元格被刪除。有沒有辦法保持所有的細胞不受影響?