This commit is contained in:
2025-09-15 00:15:49 +03:00
commit 8c1647eb13
10 changed files with 258 additions and 0 deletions

17
printer.py Normal file
View File

@@ -0,0 +1,17 @@
from escpos.printer import Network
class Printer:
def __init__(self, address: str, port: int = 9070, profile="RP-F10-80mm"):
self.address = address
self.port = port
self.profile = profile
self.printer = Network(host = self.address, port=self.port, profile=profile)
def test_connection(self):
return self.printer.is_online()
def print_text(self, text: str):
# todo text properties via printer.set()
self.printer.text(text)
self.printer.ln(2)
self.printer.cut()