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")