label_printer/test.py

14 lines
342 B
Python
Raw Normal View History

2024-09-12 18:44:00 +00:00
import ctypes
import time
2024-09-12 18:44:00 +00:00
epson = ctypes.CDLL('./library_bridge.so')
2024-09-12 18:44:00 +00:00
#epson.cut(b"/dev/usb/lp0")
#epson.cut(b"/dev/usb/lp0")
#epson.print_text(b"/dev/usb/lp0", b"test\n")
data = open("/tmp/image.png", "rb").read()
#Bytes = (ctypes.c_ubyte * len(data))(*data)
epson.print_image(b"/dev/usb/lp0", data, len(data))
#epson.cut(b"/dev/usb/lp0")