← back to articles

❯ cat python-barcode-generator.md

Python Barcode Generator

1 min readtr#Python
import barcode

def barcode_generator(str):
    image = barcode.get_barcode_class('code128')
    image_bar = image(u'{}'.format(str))
    file = open('C:\\temp\\' + str + '.svg', "wb")
    image_bar.write(file)
    return "Barcode Generated"