社区微信群开通啦,扫一扫抢先加入社区官方微信群
社区微信群
python-escpos
佳博 GP-L80180I 可以使用
pip install python-escpos
代码:
from escpos.printer import Serial
ser = Serial('COM3', 38400, timeout=1)
ser.text("Hello worldn")
#ser.image("logo.gif")
ser.barcode
ser.barcode('1324354657687','EAN13',64,2,'','')
ser.cut()
python-escpos 2.2.0
https://pypi.org/project/python-escpos/
https://python-escpos.readthedocs.io/en/latest/
from escpos.printer import Serial
ser = Serial('COM3', 38400, timeout=1)
ser.text("Hello worldn")
#ser.image("logo.gif")
ser.barcode
ser.barcode('1324354657687','EAN13',64,2,'','')
ser.qr('1234567890')
ser.cut()
可以用
不能用
from escpos.printer import Usb
""" Seiko Epson Corp. Receipt Printer M129 Definitions (EPSON TM-T88IV) """
p = Usb(0x8866, 0x0100, 0)
p.text("Hello Worldn")
# p.image("logo.gif")
p.barcode('1324354657687', 'EAN13',64,2, '','')
p.cut()
不能用的原因是:
p = Usb(0x8866, 0x0100, 0) 里面:
check_driver = self.device.is_kernel_driver_active(0)
对应的 使用的 libusb库中:
https://python-escpos.readthedocs.io/en/latest/user/todo.html
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!