python xlutils:formatting_info = True尚未实现 [英] python xlutils : formatting_info=True not yet implemented
问题描述
我有简单的代码来复制xlutils,xlrd,xlwt(从python-excel.org下载新库)而不会丢失格式的文件.我遇到如下错误:
I've got simple code to copy files with xlutils, xlrd, xlwt (downloaded new libraries from python-excel.org) with not loosing formatting. I've got an error as below:
from xlwt.Workbook import *
from xlwt.Style import *
from xlrd import open_workbook
from xlutils.copy import copy
import xlrd
style = XFStyle()
rb = open_workbook('file_master.xlsx', formatting_info=True)
wb = copy(rb.get_sheet(0))
new_book = Workbook()
w_sheet = wb.get_sheet(0)
w_sheet.write(6,6)
wb.save('new_file_master.xls')
错误:
raise NotImplementedError("formatting_info=True not yet implemented")
NotImplementedError: formatting_info=True not yet implemented
您能帮我解决这个问题还是使它工作?
Could you please help me how to work around this or rather make it work?
推荐答案
根据仅适用于xls文件,但不适用于xlsx(版本xlrd-0.8.0).
is only working for xls-files, but not for xlsx yet (Version xlrd-0.8.0).
作为解决方法,您可以使用Excel或OpenOffice将工作簿转换为xls.
As a workaround you could convert the workbook to xls using Excel or OpenOffice.
似乎可以使用 Unoconv 从xlsx到xls的命令行转换Linux,Windows和MacOSX.
It seems that a commandline conversion from xlsx to xls is possible using Unoconv on Linux, Windows and MacOSX.
这篇关于python xlutils:formatting_info = True尚未实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!