Last active
October 1, 2022 16:52
-
-
Save samirsaci/14eb25805d319f1d8530e74ac618e508 to your computer and use it in GitHub Desktop.
Graphic Automation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a function to generate and save a barcode image | |
def create_ean(number): | |
my_code = EAN13(number, writer=ImageWriter()) | |
my_code.save("Img/barcode") | |
# Import the bar code | |
create_ean(str(row['SKU Code'])) | |
bcode = Image.open('Img/barcode.png').convert("RGBA") | |
bcode = bcode.resize((int(bcode.size[0]*0.5),int(bcode.size[1]*0.5))) | |
# Add barcode | |
bg.paste(bcode, (100, 5), bcode) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment