Created
September 6, 2021 15:08
-
-
Save kedare/c21e00aff22ef77a035fde2be91b57f0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import escpos.printer | |
import sys | |
text = sys.argv[1] | |
if len(text) > 16: | |
print("Text cannot be longer than 16 characters") | |
sys.exit(1) | |
print("Connecting to printer") | |
p = escpos.printer.File("/dev/usb/lp0") | |
print("Printing") | |
p.set(double_height=True, double_width=True) | |
p.textln(text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment