class Imprimir: def __init__(self, porta_serial): self.p = Serial(porta_serial) self.p.charcode("MULTILINGUAL") self.nome_serial = porta_serial def imprimir_texto(self, texto): self.p.text(str(texto)) self.p.cut() def imprimir_imagem(self, imagem): self.p.image(str(imagem)) self.p.cut() def imprimir_qr_code(self, texto): self.p.qr(str(texto)) self.p.cut() def retornar_impressora(self): return str(self.nome_serial)
p.text("PRNCS DIA RING 00128182447 F 52000.00 T\n") p.text(" SUBTOTAL 1040000.00 \n") p.text(" TAX 1 6.250 % 65000.00 \n") p.text(" TOTAL 1105000.00 \n") p.text(" CASH TEND 1105000.00 \n") p.text(" CHANGE DUE 0.00 \n") p.text("\033a\001") # Center align p.text("# ITEMS SOLD 20\n") p.text("TC# 6802 0004 2947 2838 4956\n") p.barcode("68020004294728384956", "CODE128", height=58, width=2, pos='OFF', font='A', align_ct=True, function_type='B') p.text("Low Prices You Can Trust. Every Day.\n") p.text("05/26/20 14:24:56\n") p.text("Scan with Walmart app to save receipts\n") p.qr( "US retail giant Walmart has begun rolling out its Walmart Pay QR code-based...", size=5) p.text("\n") p.cut()