Let the user print stuff using qr example
This commit is contained in:
parent
cbc9c3b341
commit
b5349960e5
@ -1,16 +1,19 @@
|
|||||||
|
import sys
|
||||||
|
|
||||||
from escpos.printer import Usb
|
from escpos.printer import Usb
|
||||||
|
|
||||||
|
|
||||||
|
def usage():
|
||||||
|
print("usage: qr_code.py <content>")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
if len(sys.argv) != 2:
|
||||||
|
usage()
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
content = sys.argv[1]
|
||||||
|
|
||||||
# Adapt to your needs
|
# Adapt to your needs
|
||||||
p = Usb(0x0416, 0x5011, profile="POS-5890")
|
p = Usb(0x0416, 0x5011, profile="POS-5890")
|
||||||
|
p.qr(content)
|
||||||
# Some software barcodes
|
|
||||||
p.set(align='left')
|
|
||||||
|
|
||||||
p.text("hello\n")
|
|
||||||
|
|
||||||
p.qr("https://github.com/python-escpos/python-escpos")
|
|
||||||
|
|
||||||
p.text("world\n")
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user