python-escpos 小票 打印 机 - Go语言中文社区

python-escpos 小票 打印 机


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

可以用

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

在这里插入图片描述

在这里插入图片描述

版权声明:本文来源CSDN,感谢博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/wowocpp/article/details/105811192
站方申明:本站部分内容来自社区用户分享,若涉及侵权,请联系站方删除。
  • 发表于 2021-05-16 20:10:06
  • 阅读 ( 846 )
  • 分类:

0 条评论

请先 登录 后评论

官方社群

GO教程

猜你喜欢