From ca45d2567035d7469a8d80cfcdb67f6aa2a4c858 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 9 Mar 2020 23:18:36 +1100 Subject: [PATCH] Update README.rst Added example on serial. --- README.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.rst b/README.rst index 3eebf6d..6e8901d 100644 --- a/README.rst +++ b/README.rst @@ -76,6 +76,25 @@ Another example based on the Network printer class: kitchen.text("Hello World\n") kitchen.barcode('1324354657687', 'EAN13', 64, 2, '', '') 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 `_.