Update README.rst

Added example on serial.
This commit is contained in:
Brian 2020-03-09 23:18:36 +11:00 committed by GitHub
parent 51d1299285
commit ca45d25670
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 0 deletions

View File

@ -77,6 +77,25 @@ Another example based on the Network printer class:
kitchen.barcode('1324354657687', 'EAN13', 64, 2, '', '') kitchen.barcode('1324354657687', 'EAN13', 64, 2, '', '')
kitchen.cut() kitchen.cut()
Another example based on the Network printer class:
.. code:: python
from escpos.printer import Serial
""" 9600 Baud, 8N1, Flow Control Enabled """
p = Serial(devfile='/dev/tty.usbserial',
baudrate=9600,
bytesize=8,
parity='N',
stopbits=1,
timeout=1.00,
dsrdtr=True)
p.text("Hello World\n")
p.qr("You can readme from your smartphone")
p.cut()
The full project-documentation is available on `Read the Docs <https://python-escpos.readthedocs.io>`_. The full project-documentation is available on `Read the Docs <https://python-escpos.readthedocs.io>`_.