Posts

Showing posts from February 28, 2019

openpyxl - How to add an image to worksheet?

Image
0 I have already read the documentation at https://media.readthedocs.org/pdf/openpyxl/latest/openpyxl.pdf, in order to understand how to add an image to a worksheet. And so, used the following code to write my test program: from openpyxl.drawing.image import Image as XLIMG from openpyxl.worksheet import Worksheet from openpyxl import Workbook wb = Workbook() ws = wb.active img = XLIMG('example.png') ws.add_image(img, 'A1') wb.save("test.xlsx") Actually, the code works, and reproduces an xlsx file. However when I open the file using LibreOffice Calc, I don't see any image object, but instead empty cell at 'A1'. I'm also pretty sure that the png file is neither empty, nor corrupt. Concerning the versions, I'm currently using OpenPyXL 2.5.11 and Libr

SagePay: Test card details not being accepted

Image
1 I'm building an integrated payment form with SagePay, and have previously been successful making payments to a test account using the test card details provided in page 24 of this documentation: https://www.sagepay.co.uk/file/25041/download-document/FORM_Integration_and_Protocol_Guidelines_270815.pdf?token=dyWjqsDOzcE9qp5wU39w0DiSx525HSqfiV9OV6EGQB8 However, when I try and pay again with card details in that list that have previously worked, the SagePay form highlights the card number field in red and says "The Card Range not supported by the system." I've asked the admin of this particular SagePay test account to check if any card ranges have been automatically banned, or something to that affect. Until I get a response, is there anything else that I could be looking out for?