我有一台爱普生热敏打印机(TM-82),通过USB连接。我正在使用python-escpos库(版本v2.2.0),我试图运行一些Escpos module's方法,例如ln()
,textln()
等。但是这些命令都不起作用,我得到一个错误'Usb' object has no attribute <method_name>
。唯一有效的命令是text()
、qrcode()
、barcode()
、image()
和{
你们能告诉我怎么了吗?在
复制步骤
>>> from escpos import printer
>>> p = printer.Usb(0x04b8, 0x0e11, 0)
>>> p.text('hello')
>>> p.ln()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'Usb' object has no attribute 'ln'
>>> p.is_online()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'Usb' object has no attribute 'is_online'
如果您使用的是pythonsescpos2.2.0,请查看source and documentation for that version。在
该版本中没有
ln
或is_online
函数。在相关问题 更多 >
编程相关推荐