
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
22 lines
392 B
Python
22 lines
392 B
Python
"""Print example QR codes."""
|
|
import sys
|
|
|
|
from escpos.printer import Usb
|
|
|
|
|
|
def usage():
|
|
"""Print information on usage."""
|
|
print("usage: qr_code.py <content>")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
if len(sys.argv) != 2:
|
|
usage()
|
|
sys.exit(1)
|
|
|
|
content = sys.argv[1]
|
|
|
|
# Adapt to your needs
|
|
p = Usb(0x0416, 0x5011, profile="POS-5890")
|
|
p.qr(content, center=True)
|