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


本文详细介绍了如何使用python-escpos库进行热敏打印机操作,包括安装库、配置串口连接以及打印文本、条形码和二维码的方法。同时,探讨了在Windows环境下使用USB方式连接打印机的限制及可能的原因。
4042

被折叠的 条评论
为什么被折叠?



