问题描述
我们需要使用python脚本更新xlsx工作表,该脚本会进行一些计算并更新一个工作表.我选择openpyxl是因为它支持编写/更新xlsx文件.在Excel工作表中还包含一些图形,但是当我更新Excel工作表时,图形不起作用分别转换为excel和数据更新.我认为我们在使用openpyxl更新图形时遇到了一些问题.有人可以向我提供一些信息来解决此问题
We need to update xlsx sheet using python script which do some calcualtion and update one worksheet.I choose openpyxl as it supoort writing/updating xlsx File.In the Excel sheet contain some graphs also but When I update excel sheet than graph does not workinto excel and data update respectively.I think we had some issue for updating graph with openpyxl.Can anyone provide me some input to fix this issue
或者换句话说,在Excel工作表中,我有10个工作表.在工作表1中,它包含图形.我已经更新了工作表编号5.工作表已成功更新.但是我丢了工作表1的图表.
or In other word,In the Excel sheet I have 10 worksheet.In worksheet 1, it contain graphs. I have updated worksheet number 5. Worksheet is updated successfully. But I have loose the graphs of worksheet 1.
#!/usr/bin/env python
from openpyxl import load_workbook
import openpyxl
print "pylx"
ddr_sam45_flop = "Flip_Flop.xlsx"
flop_workbook = load_workbook(ddr_sam45_flop)
raw_flop_workbook = flop_workbook.get_sheet_by_name(name ='RAW')
raw_flop_workbook.cell(row = 1 , column = 1).value = 889999
flop_workbook.save(ddr_sam45_flop)
print "End"
(请认为我是openpyxl的新手)
(Please consider me new to openpyxl)
推荐答案
Openpyxl目前不支持图形或图表
Openpyxl does not support graphs or chart as of now
这篇关于xlsx中的图形由openpyxl覆盖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!