label_printer/test.py

13 lines
342 B
Python

import ctypes
import time
epson = ctypes.CDLL('./library_bridge.so')
#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")