2024-09-12 18:44:00 +00:00
|
|
|
import ctypes
|
2024-09-15 15:46:04 +00:00
|
|
|
import time
|
2024-09-12 18:44:00 +00:00
|
|
|
|
2024-09-15 15:46:04 +00:00
|
|
|
epson = ctypes.CDLL('./library_bridge.so')
|
2024-09-12 18:44:00 +00:00
|
|
|
|
2024-09-15 15:46:04 +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)
|
2024-09-12 20:58:05 +00:00
|
|
|
|
2024-09-15 15:46:04 +00:00
|
|
|
epson.print_image(b"/dev/usb/lp0", data, len(data))
|
|
|
|
#epson.cut(b"/dev/usb/lp0")
|