用户工具

站点工具


linux:python:python-escpos

这是本文档旧的修订版!


python-escpos

https://github.com/mosquito/python-escpos

用python实现控制小票机打印。

<code python>

from escpos import *

“”“ Seiko Epson Corp. Receipt Printer M129 Definitions (EPSON TM-T88IV) ”“” Epson = escpos.Escpos(0x04b8,0x0202,0) Epson.text(“Hello World”) Epson.image(“logo.gif”) Epson.barcode Epson.barcode(‘1324354657687’,'EAN13’,64,2,’',’') Epson.cut()

</code>

<code python>

with EscposIO(printer.Network(‘192.168.1.87’, port=9100)) as p:

p.set(font='a', codepage='cp1251', size='normal', align='center', bold=True)
p.printer.set(align='center')
p.printer.image('logo.gif')
p.writelines('Big line\n', font='b')
p.writelines(u'Привет', color=2)
p.writelines(u'BIG TEXT', size='2x')

After exit of with, printer will cut the paper

</code>

linux/python/python-escpos.1791900372.txt.gz · 最后更改: 由 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki