python-escpos 小票 打印 机

python-escpos
佳博 GP-L80180I 可以使用
pip install python-escpos
代码:

from escpos.printer import Serial
ser = Serial('COM3', 38400, timeout=1)
ser.text("Hello world\n")
#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 world\n")
#ser.image("logo.gif")
ser.barcode
ser.barcode('1324354657687','EAN13',64,2,'','')
ser.qr('1234567890')
ser.cut()

可以用

windows 下为何 python-escpos 库中的 usb的方式不能用呢?

不能用

from escpos.printer import Usb

""" Seiko Epson Corp. Receipt Printer M129 Definitions (EPSON TM-T88IV) """
p = Usb(0x8866, 0x0100, 0)
p.text("Hello World\n")
# 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

在这里插入图片描述

在这里插入图片描述

  • 2
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值