Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Print barcodes on a zebra printer
import sys
# needs pip install zebra
from zebra import zebra
# Replace the string below.
# You can get valid names from zebra().getqueues()
printer_name = "Zebra_Technologies_ZTC_GC420d__EPL__2"
z = zebra(printer_name)
# Assumes a 1" W x 3" H label mounted at the center
# of a 4 x 6 label printer
label_height=(600, 12),
template = """^XA
def print_barcode(barcode):
z.output(template % barcode)
if __name__ == '__main__':
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.