使用Python打印到打印机弹簧弹簧

2024-06-06 19:46:48 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图用python打印到打印机上escpos.打印机模块,但一直得到这个错误没有实现错误:操作不支持或没有实现在这个平台上,我有搜索没有用,我正在使用windows 7 64位操作系统。以下是来自的默认代码escpos.打印机 我也找到了这个答案,但它不起作用Pyusb on Windows 7 - NotImplemented Error :is_kernal_driver_active

[docs](https://python-escpos.readthedocs.io/en/latest/index.html)!
from escpos.printer import Usb

""" Seiko Epson Corp. Receipt Printer (EPSON TM-T88III) """
p = Usb(0x0483,0x5743)
p.text("Hello World\n")
p.image("logo.gif")
p.barcode('1324354657687', 'EAN13', 64, 2, '', '')
p.cut()
Traceback (most recent call last):
  File "C:\Users\admin\Desktop\test\testGround\test.py", line 50, in <module>
    p = Usb(0x0483,0x5743)
  File "C:\Python36\lib\site-packages\escpos\printer.py", line 51, in __init__
    self.open()
  File "C:\Python36\lib\site-packages\escpos\printer.py", line 77, in open
    self.device.set_configuration()
  File "C:\Python36\lib\site-packages\usb\core.py", line 869, in set_configuration
    self._ctx.managed_set_configuration(self, configuration)
  File "C:\Python36\lib\site-packages\usb\core.py", line 102, in wrapper
    return f(self, *args, **kwargs)
  File "C:\Python36\lib\site-packages\usb\core.py", line 147, in managed_set_configuration
    self.managed_open()
  File "C:\Python36\lib\site-packages\usb\core.py", line 102, in wrapper
    return f(self, *args, **kwargs)
  File "C:\Python36\lib\site-packages\usb\core.py", line 120, in managed_open
    self.handle = self.backend.open_device(self.dev)
  File "C:\Python36\lib\site-packages\usb\backend\libusb1.py", line 786, in open_device
    return _DeviceHandle(dev)
  File "C:\Python36\lib\site-packages\usb\backend\libusb1.py", line 643, in __init__
    _check(_lib.libusb_open(self.devid, byref(self.handle)))
  File "C:\Python36\lib\site-packages\usb\backend\libusb1.py", line 593, in _check
    raise NotImplementedError(_strerror(ret))
NotImplementedError: Operation not supported or unimplemented on this platform
[Finished in 0.3s]


Tags: inpycoreselflibpackageslinesite