Module escpos.cli


This module acts as a command line interface for python-escpos. It mirrors closely the available ESCPOS commands while adding a couple extra ones for convenience.

It requires you to have a configuration file. See documentation for details.


Used as a type in argparse so that we get back a proper bool instead of always True


Handles loading of configuration and creating and processing of command line arguments. Called when run from a CLI.

escpos.cli.demo(printer, **kwargs)[source]

Prints demos. Called when CLI is passed demo. This function uses the DEMO_FUNCTIONS dictionary.

  • printer – A printer from escpos.printer

  • kwargs – A dict with a key for each function you want to test. It’s in this format since it usually comes from argparse.