Skip to content

Instantly share code, notes, and snippets.

@samirsaci
Last active October 1, 2022 16:52
Show Gist options
  • Save samirsaci/14eb25805d319f1d8530e74ac618e508 to your computer and use it in GitHub Desktop.
Save samirsaci/14eb25805d319f1d8530e74ac618e508 to your computer and use it in GitHub Desktop.
Graphic Automation
# 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