python-escpos/examples/barcodes.py
Patrick Kanzler fbabd8ed88
Drop Py37, improve typing and docstrings (#544)
Drops Py3.7, improves typing and adds a mypy config, improves the docstrings and isorts the imports.

* configure isort
* sort with isort
* add github action
* enable flake8-docstrings
* fix docstrings
* add mypy env
* no implicit optional
* add type for raw
* add some type hints
2023-08-15 01:03:36 +02:00

12 lines
317 B
Python

"""Example for printing barcodes."""
from escpos.printer import Usb
# Adapt to your needs
p = Usb(0x0416, 0x5011, profile="TM-T88II")
# Print software and then hardware barcode with the same content
p.barcode("123456", "CODE39", width=2, force_software=True)
p.text("\n")
p.text("\n")
p.barcode("123456", "CODE39")