Skip to content

Instantly share code, notes, and snippets.

@ngaranko
Last active August 14, 2019 13:23
Show Gist options
  • Save ngaranko/9b9755ecf86658c845552694c25c4e02 to your computer and use it in GitHub Desktop.
Save ngaranko/9b9755ecf86658c845552694c25c4e02 to your computer and use it in GitHub Desktop.
ttt.py
import tempfile
import barcode
import cups
import pdfkit
from barcode.writer import ImageWriter
def print_barcode(value):
printer_conn = cups.Connection()
printer_conn.printFile(
'DYMO_LabelWriter_450',
'/tmp/test.pdf',
"PDF Print",
{}
)
if __name__ == '__main__':
print_barcode('667676676')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment