if anybody can help me, please.
I am trying to work with an excel (xlsx) file that has images. The file is in a Gcloud storage Bucket that is downloaded from the main.py (flask) and is send to a python function in another file (createReport.py) the file is read, change and all functions well, but when I save it, the file doesn′t include the images from the template file.
This is han example of the code:
@app.route('/', methods= ['GET', 'POST'])
def root():
wb = io.BytesIO()
blob = bucket.blob(pathReportfile)
blob.download_to_file(wb)
wb = create(wb)
blob = bucket.blob(path)
blob.upload_from_string(wb.getvalue())
wb.close
return render_template('index.html')
def create(wb):
wbReport = openpyxl.load_workbook(wb, read_only=False)
.
#makes changes to the file only data
.
wb = io.BytesIO()
wbInforme.save(wb)
wbInforme.close
return wb
The file is downloaded directly from the public storage bucket "-https:www.google.com/...excelprojects..."
The image in the left is the template and the image on the right is the downloaded file:
enter image description here
Thanks
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…