Skip to content

Instantly share code, notes, and snippets.

@muimota
Created January 27, 2019 18:02
Show Gist options
  • Save muimota/5eec694804a6d256f3e879226a0d4cd3 to your computer and use it in GitHub Desktop.
Save muimota/5eec694804a6d256f3e879226a0d4cd3 to your computer and use it in GitHub Desktop.
Print example os escpos printer Citizen S300
#uses python-escpos
#https://github.com/python-escpos/python-escpos
#2019 muimota
from escpos.printer import File
import os
p = File("/dev/usb/lp0")
p.text("Hello World\n")
if os.path.isfile('logo.gif'):
p.image("logo.gif")
else:
p.text('logo.gif not found!')
p.barcode('1324354657687', 'EAN13', 64, 2, '', '')
p.qr("http://martinnadal.eu")
p.cut()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment