GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - fozzle/python-brotherprint: Brother QL-580N networked printers library for Python

BranchesTags
Open more actions menu

Latest commit

 

History

28 Commits
28 Commits

Folders and files

NameName
Last commit message
Last commit date
brotherprint
brotherprint
 
 
.gitignore
.gitignore
 
 
CHANGES.txt
CHANGES.txt
 
 
LICENSE.txt
LICENSE.txt
 
 
MANIFEST
MANIFEST
 
 
README
README
 
 
README.md
README.md
 
 
setup.py
setup.py
 
 

Repository files navigation

WARNING: This project is not actively maintained, use at your own risk. Seeking new maintainer

python-brotherprint

Brother networked label printers library for Python

This was developed for the QL-580N but I've heard it also works for the following:

  • QL-720NW

Installation

The easiest way to install this package is with pip.

pip install brotherprint

Usage

This library supports two printing modes. ESC/P commands, and templates. I highly recommend using templates, because it is easier to manage, and offers more features. I will, however, go over both. You should review the official Brother documentation here (ESCP Docs) and here (Template Command Docs), to know what is available.

Setup

Regardless of which mode you are using, you need to intialize and connect a socket object, and pass the resulting socket object to the BrotherLabel object instantiator.

from brotherprint import BrotherPrint
from socket
f_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
f_socket.connect(('<ip_address>', <port (9100 by default for QL580N)>))
printjob = BrotherPrint(f_socket)

ESC/P Printing

Invoke escp commands through certain BrotherLabel object methods (see actual file for method descriptions) Make sure to end with the print page command, signifying the end of a label.

printjob.command_mode()
printjob.initialize()
printjob.bold('on')
printjob.send(<text>)
printjob.print_page(<cut_setting>)

Template Printing

Create your template and upload it to the printer. After creating a BrotherLabel object, call template_mode() to set the printer to template mode, and then use the template commands to fill in your label.

printjob.template_mode()
printjob.template_init()
printjob.choose_template(<template_number>)
printjob.select_and_insert(<field_name>, <data>)
printjob.select_and_insert(<field_name2>, <data2>)
printjob.select_and_insert(<field_name3>, <data3>)
printjob.template_print()

About

Brother QL-580N networked printers library for Python

Resources

Readme
MIT license
Activity

Stars

43 stars

Watchers

9 watching

Forks

32 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.