2023-08-14 23:03:36 +00:00
|
|
|
"""Print example QR codes."""
|
2017-07-24 13:04:54 +00:00
|
|
|
import sys
|
|
|
|
|
|
|
|
from escpos.printer import Usb
|
|
|
|
|
|
|
|
|
|
|
|
def usage():
|
2023-08-14 23:03:36 +00:00
|
|
|
"""Print information on usage."""
|
2017-07-24 13:04:54 +00:00
|
|
|
print("usage: qr_code.py <content>")
|
|
|
|
|
|
|
|
|
2021-10-30 16:15:22 +00:00
|
|
|
if __name__ == "__main__":
|
2017-07-24 13:04:54 +00:00
|
|
|
if len(sys.argv) != 2:
|
|
|
|
usage()
|
|
|
|
sys.exit(1)
|
|
|
|
|
|
|
|
content = sys.argv[1]
|
|
|
|
|
|
|
|
# Adapt to your needs
|
|
|
|
p = Usb(0x0416, 0x5011, profile="POS-5890")
|
2017-08-31 07:25:35 +00:00
|
|
|
p.qr(content, center=True)
|