python-escpos/examples/qr_code.py
Romain Porte 5bd6dcf471 Ensure QR codes have a border large enough (#235)
*  Ensure QR codes have a border large enough
(The QR code spec requires a border at least 4*box_size thick but we can't
 just set border=16 because that results in a QR code more than 255px tall
 and I'm not yet ready to use fullimage() as a backend for it)
This fix was originally commited by Stephan Sokolow on 2014-05-22
* Let the user print stuff using qr example
* fix tests
2017-07-24 15:04:54 +02:00

20 lines
311 B
Python

import sys
from escpos.printer import Usb
def 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)