Driver for the DP-EH600 thermal printer (AdaFruit).
Project description
Python module to manage the DP-EH600 thermal printer (the one sold by AdaFruit).
Python 3+ only and PEP8 compliant;
this is a clean follow of the technical manual with few helpers;
and there is a complete, and beautiful, documentation :)
also several useful recipes;
contibutors are welcome, check the developer guide!
Installation
As simple as:
python3 -m pip install --upgrade --user thermalprinter
Usage
An example is better than thousand words:
from PIL import Image
from ThermalPrinter import *
with ThermalPrinter(port='/dev/ttyAMA0') as printer:
# Picture
printer.image(Image.open('gnu.png'))
# Bar codes
printer.barcode_height(80)
printer.barcode_position(BarCodePosition.BELOW)
printer.barcode_width(3)
printer.barcode('012345678901', BarCode.EAN13)
# Styles
printer.out('Bold', bold=True)
printer.out('Double height', double_height=True)
printer.out('Double width', double_width=True)
printer.out('Inverse', inverse=True)
printer.out('Rotate 90°', rotate=True, codepage=CodePage.ISO_8859_1)
printer.out('Strike', strike=True)
printer.out('Underline', underline=1)
printer.out('Upside down', upside_down=True)
# Chinese (almost all alphabets exist)
printer.out('现代汉语通用字表', chinese=True,
chinese_format=Chinese.UTF_8)
# Greek (excepted the ΐ character)
printer.out('Στην υγειά μας!', codepage=CodePage.CP737)
# Accents
printer.out('Voilà !', justify='C', strike=True,
underline=2, codepage=CodePage.ISO_8859_1)
# Line feeds
printer.feed(2)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file thermalprinter-0.2.0.tar.gz.
File metadata
- Download URL: thermalprinter-0.2.0.tar.gz
- Upload date:
- Size: 25.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb96f9b96d3c97a236551cd92c0442aa32c418281a5b449ed337e0350d90bd6c
|
|
| MD5 |
cfe0b4de63a34874ccf378e1ea4fb1f2
|
|
| BLAKE2b-256 |
e265948448402c2c38de7d5af4037c00c414811f00b35382bd67c14f997a9950
|
File details
Details for the file thermalprinter-0.2.0-py2.py3-none-any.whl.
File metadata
- Download URL: thermalprinter-0.2.0-py2.py3-none-any.whl
- Upload date:
- Size: 26.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f6101ba749ad4e66663a5a1cceae6b7f028c59035acc412df7d1182e9acfaae
|
|
| MD5 |
8ed66265f4aa3ff2a2a043bdaf88e98f
|
|
| BLAKE2b-256 |
b84819049365988d9e3a1d484bffbdf354a22646bed047e2231cf30405330b9d
|