Skip to content
This repository was archived by the owner on Mar 23, 2025. It is now read-only.

Commit dfd1874

Browse files
author
Adrian Tschira
committed
expand on readme
1 parent 98ff5e5 commit dfd1874

1 file changed

Lines changed: 24 additions & 8 deletions

File tree

README.md

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,38 @@ Labelprinterkit's simple layout engine can be used to declaratively create
88
simple labels:
99

1010
```python
11-
>>> class MyLabel(Label):
12-
... items = [
13-
... Text(), Text()
14-
... ]
15-
...
16-
>>> l = MyLabel("text1", "text2")
17-
>>> printer.print_label(l)
11+
from Labelprinterkit import backends, items, label
12+
from Labelprinterkit.printers.brother_pt700 import P700
13+
14+
# Define the layout of our label
15+
# We define a single row with two text items.
16+
# In real usage, you will probably want to change the font of the text.
17+
class MyLabel(label.Label):
18+
items = [
19+
items.Text(pad_right=50), items.Text()
20+
]
21+
22+
# Instantiate the label with specific data
23+
l = MyLabel("text1", "text2")
24+
# scan for a USB printer using the PyUSBBackend
25+
printer = P700(PyUSBBackend.auto()
26+
# Print!
27+
printer.print_label(l)
1828
```
1929

2030
The Following printers are currently supported:
2131

2232
* Brother P-Touch PT-700 (aka P700)
2333

24-
The following printers will probably work, but are not tested:
34+
The following printers will probably work, as they are supposedly identical,
35+
but have not been tested (please tell us if they do!):
2536

2637
* Brother H500
2738
* Brother E500
2839

40+
The following backends are currently supported:
41+
42+
* USB Printer Device Class via PyUSB
43+
2944
The official source of this repository is at https://git.scc.kit.edu/scc-net/labelprinterkit.
45+
Pull requests and issues are also accepted on github at https://github.com/notafile/labelprinterkit.

0 commit comments

Comments
 (0)